LoadError wrote: ↑Mon May 24, 2021 6:10 pm
I've just finished porting my dice program to the ZX80, or should I say "rewriting". The '81 version is centered around the PRINT AT instruction which is missing in the '80, so I had to rethink the whole thing. I'm happy with the result (I just stripped down the animations because they would not make sense on a ZX80 anyway). I guess the fact that the '80 BASIC is integer only did help though, because I had no problems making it fit in 1K without the tricks I had to use on the 81 (like replacing numbers with integer variables). The only problem now is: I WANT A ZX80! That's about as hardcore as it gets, this side of an Altair 8800!
The ZX80 is not only more efficient in memory terms but also much faster in terms of BASIC speed!
The only drawbacks are that you should not require video interactions and floating points!
Here are 2 versions of a DICE program running in only 1K of memory. One made with PLOT and the other with PRINT.
The first one is from a version I pick up on a forum (I forgot where). It was created by 'poglad'. I cut the number of bytes from 333 bytes in 18 lines to 249 bytes in 15 lines. The 2nd version was made with PRINT. And the dots are bigger but the number of bytes is 281 bytes in 12 lines. Enjoy, ANDRE***
There are 3 types of difficulties: Each screen has a secret to open the gates. There are keys in some screen that will open certain doors in other screens. Also there are good potions to strenghten you because you have drop yourself from a second floor. And in all screens there is a way in/out on each side. Have fun, ANDRE***
10 REM 010203213404414444
20 LET A$=" * * ** *"
30 LET A=INT(RND*6)
40 PRINT AT 0,0;A+1;AT 4,9;"\::\::\::\::\::";TAB 9;"\::\::\::\::\::";TAB 9;"\::\::\::\::\::";TAB 9;"\::\::\::\::\::";TAB 9;"\::\::\::\::\::";AT 5,0;
50 FOR C=0 TO 2
60 LET D=(PEEK (16514+A*3+C)-28)*3+1
70 PRINT TAB 10;A$(D TO D+2)
80 NEXT C
90 PAUSE 4E4
100 RUN
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Here are my 2 versions of "BOUNCE" and "BOUNCE" with PLOT. My versions includes bytes saving.
OR 227 bytes in 16 lines
AB 150 bytes in 11 lines
OR 217 bytes in 14 lines (PLOT)
AB 176 bytes in 13 lines (PLOT)
All these versions do not run in 1K, but my version with 150 bytes does run in 2K.
And you will notice the speed the ball bounces.