0

So I made a point system for a game on the TI-82. The points are stored as the variable P. I first tried using the Disp command to display the variable and text at the right place, but that didn't work with mixed text and variables. So instead I switched to using the output command, but that always puts the variable and text at a fixed position, which means that as the variable gets more digits, the space between the variable and text shrinks. I tried using the log of the variable for the position, but that didn't work because most of the time it returned decimals. Here is my current code for displaying the points:

Output(2,1,P
Output(2,3,"POINTS

Does anyone know how to increase the spacing between the variable and the text depending on how many digits the variable has?

AronYstad
  • 11
  • 2

2 Answers2

0

Log works if you round it down and add 1.

int(log(P)) + 1

will give you the number of digits. Why not just round up instead? Because log(10) = 1 but 10 is 2 digits.

chiliNUT
  • 18,989
  • 14
  • 66
  • 106
0

This is pretty simple, just put the variable after the points, so instead of doing:

Output(2,1,P
Output(2,3,"POINTS

Do instead:

Output(2,1,"POINTS
Output(2,8,P