Can't make anything fit into 1K... or is it me?

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
User avatar
marste
Posts: 194
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: Can't make anything fit into 1K... or is it me?

Post by marste »

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! :lol:
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!
Andre
Posts: 25
Joined: Sat Jun 21, 2008 7:28 pm
Location: Chateauguay-Quebec-Canada
Contact:

Re: Can't make anything fit into 1K... or is it me?

Post by Andre »

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***
Attachments
DICEBAB.P
(422 Bytes) Downloaded 9 times
DICEAA.P
(390 Bytes) Downloaded 7 times
The ZX81 pleasure is spreading, ANDRE***
http://zx81.ordi5.free.fr/andre
http://zx81.de/andre
User avatar
mrtinb
Posts: 1389
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Can't make anything fit into 1K... or is it me?

Post by mrtinb »

Andre wrote: Mon Jun 07, 2021 4:17 am ANDRE***
Great to see you back at the forum. I personally love ZX91 magazines you’ve created.
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Moggy
Posts: 2445
Joined: Wed Jun 18, 2008 2:00 pm

Re: Can't make anything fit into 1K... or is it me?

Post by Moggy »

The king of BASIC is back! :D

( I still cannot get Yoogore and his bloody shield out of the castle!)
Andre
Posts: 25
Joined: Sat Jun 21, 2008 7:28 pm
Location: Chateauguay-Quebec-Canada
Contact:

Re: Can't make anything fit into 1K... or is it me?

Post by 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***
The ZX81 pleasure is spreading, ANDRE***
http://zx81.ordi5.free.fr/andre
http://zx81.de/andre
User avatar
XavSnap
Posts: 1296
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Can't make anything fit into 1K... or is it me?

Post by XavSnap »

Thanks ANDRÉ *** !
Welcome back...
Xavier
User avatar
XavSnap
Posts: 1296
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Can't make anything fit into 1K... or is it me?

Post by XavSnap »

DICE.P
(1.3 KiB) Downloaded 6 times

Code: Select all

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
Cap0001.jpg
Xavier
Post Reply