IGNORED

# Remove 2nd digit from score?

## Recommended Posts

Hi,

I'm looking for a simple way to remove the 2nd digit from the score in Batari Basic. So instead of having "000000" it will look like "0 0000". Any help or pointers in the right direction would be most appreciated!

Thanks!

##### Share on other sites

I've never programmed for the Atari 2600 so going about this may be completely different than what I would be thinking. But I would think if I have a 6 digit number I would want to divide the number by 100,000 and that without the remainder would be the digit to the left that a variable would be assigned to for use with that one digit by itself. Then for the other I would take the the total score and subtract the (that variable times 100,000) and what would be left would be the the 5 digit number, then divide that by 10,000 and that gives you the value for digit 5 and store it as a variable, so then you could take the 5 digit number and subtract the (that variable times 10,000), which will leave you with the 4 digit number that you can then display next. Like I said though I've never programmed on the 2600 and there are other ways to do that also but I was trying to do it thinking of an easy to understand way to do it, if it can even be done like that on it I have no clue.

##### Share on other sites

I've never programmed for the Atari 2600 so going about this may be completely different than what I would be thinking. But I would think if I have a 6 digit number I would want to divide the number by 100,000 and that without the remainder would be the digit to the left that a variable would be assigned to for use with that one digit by itself. Then for the other I would take the the total score and subtract the (that variable times 100,000) and what would be left would be the the 5 digit number, then divide that by 10,000 and that gives you the value for digit 5 and store it as a variable, so then you could take the 5 digit number and subtract the (that variable times 10,000), which will leave you with the 4 digit number that you can then display next. Like I said though I've never programmed on the 2600 and there are other ways to do that also but I was trying to do it thinking of an easy to understand way to do it, if it can even be done like that on it I have no clue.

Thanks for the reply. I have no concerns with the values of the score, I just need that 2nd digit to not be on the screen. Even better - to have the 2nd and 3rd digit removed.

##### Share on other sites

I just wanted to show what I was trying to explain.

<?php
\$score = 728437;
echo "Example score is \$score<br>";
\$leftdigit = \$score / 100000;
\$leftdigitnoremainder = (floor(\$leftdigit));
\$fivedigits = \$score - (\$leftdigitnoremainder * 100000);
\$fifthdigit = \$fivedigits / 10000;
\$fifthdigitnoremainder =(floor(\$fifthdigit));
\$fourdigits = \$fivedigits - (\$fifthdigitnoremainder * 10000);
echo "\$leftdigitnoremainder \$fourdigits";

?>

You can put this in at http://phptester.net/ if you want to test it out. I know it will be different programming I just wanted to explain the logic behind it.

Edited by SignGuy81
##### Share on other sites

SignGuy,

Batari will also accept ASM, but I don't know how to program in it.

##### Share on other sites

Thanks for the replies thus far. Perhaps I'm not explaining myself well (which I often do :-) ) All i want to do is make the 2nd (or 2nd and 3rd digit) of the score not show. I don't want to change the numbers into an inventory system - I need the number sprites to remain as they are. In 2013 years ago I had posted a similar question about removing the center two numbers, and someone provided some ASM to do this and it worked great. Unfortunately I don't have that code anymore, I can't find the thread, and even if I did I don't know if would help in this situation.

##### Share on other sites

I recommend using RevEng's custom score_graphics.asm. I've done this to have blank spaces at certain points in my project. Let me know if you need any usage examples that aren't explained in this thread:

http://atariage.com/forums/topic/147450-custom-fonts-for-bb-all-in-one-score-graphicsasm/

##### Share on other sites

I just wanted to show what I was trying to explain.

<?php

\$score = 728437;

echo "Example score is \$score<br>";

\$leftdigit = \$score / 100000;

\$leftdigitnoremainder = (floor(\$leftdigit));

\$fivedigits = \$score - (\$leftdigitnoremainder * 100000);

\$fifthdigit = \$fivedigits / 10000;

\$fifthdigitnoremainder =(floor(\$fifthdigit));

\$fourdigits = \$fivedigits - (\$fifthdigitnoremainder * 10000);

echo "\$leftdigitnoremainder \$fourdigits";

?>

You can put this in at http://phptester.net/ if you want to test it out. I know it will be different programming I just wanted to explain the logic behind it.

I know it doesn't matter now because it is different but I thought either way I should correct my mistake I didn't think of earlier which is that in my code above I completely overlooked if any digit was a zero(oops) so I made some changes which work now

<?php

\$score = 192387; //any number up to six digits, don't put zeros in front like 023455, instead do 23455

echo "Example score is \$score<br>";

\$leftdigit = \$score / 100000;

\$leftdigitnoremainder = (floor(\$leftdigit));

\$fivedigits = \$score - (\$leftdigitnoremainder * 100000);

\$fifthdigit = \$fivedigits / 10000;

\$fifthdigitnoremainder =(floor(\$fifthdigit));

\$fourdigits = \$fivedigits - (\$fifthdigitnoremainder * 10000);

\$fourthdigit = \$fourdigits / 1000;

\$fourthdigitnoremainder =(floor(\$fourthdigit));

\$threedigits = \$fourdigits - (\$fourthdigitnoremainder * 1000);

\$thirddigit = \$threedigits / 100;

\$thirddigitnoremainder =(floor(\$thirddigit));

\$twodigits = \$threedigits - (\$thirddigitnoremainder * 100);

\$seconddigit = \$twodigits / 10;

\$seconddigitnoremainder = (floor(\$seconddigit));

\$onedigit = \$twodigits - (\$seconddigitnoremainder * 10);

\$firstdigit = \$onedigit / 1;

\$firstdigitnoremainder = (floor(\$firstdigit));

echo "\$leftdigitnoremainder \$fourthdigitnoremainder\$thirddigitnoremainder\$seconddigitnoremainder\$firstdigitnoremainder";

?>

Now any number you put for the first line for example \$score will come out in the format 0 0000, for example 845932 will provide 8 5932 as did with my first post but now 004056(put it in as 4056 though no zeroes in front) will come out correctly as 0 4056

edit:

Took me a bit but came up with a shorter version does same thing

<?php

\$score = 987693;// Example score

\$numdigits = strlen(\$score);

if(\$numdigits < 6){

}else{

}

do{

\$array[] = 0;

}

\$newarray = str_split(\$score);

\$place = 0;

do{

\$array[] = \$newarray[\$place];

\$numdigits --;

\$place ++;

}while (\$numdigits > 0);

echo "\$array[0] \$array[2]\$array[3]\$array[4]\$array[5]";

?>

Edited by SignGuy81
##### Share on other sites

I recommend using RevEng's custom score_graphics.asm. I've done this to have blank spaces at certain points in my project. Let me know if you need any usage examples that aren't explained in this thread:

http://atariage.com/forums/topic/147450-custom-fonts-for-bb-all-in-one-score-graphicsasm/

Not looking to change the font, or artificially "remove it" as a sprite. I just don't want the 2nd digit drawn. I found the original thread I was referring to here. http://atariage.com/forums/topic/215110-three-two-digit-scores/?hl=score+graphics&do=findComment&comment=2804136

##### Share on other sites

Using that previous thread I figured it out. Thank you everyone!

##### Share on other sites

You should explain how you did it!

##### Share on other sites

The thread reveals it. Setting NUSIZ registers to 2 for 4 digits (0000), setting them to 4 for 2 pairs of digits (00 00). Setting NUSIZ0 to 2 and NUSIZ1 to 3 would produce 0000 0.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.