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: 250
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: 46
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 145 times
DICEAA.P
(390 Bytes) Downloaded 153 times
The ZX81 pleasure is spreading, ANDRE***
http://zx81.ordi5.free.fr/andre
http://zx81.de/andre
User avatar
mrtinb
Posts: 1906
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
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Moggy
Posts: 3231
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: 46
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: 1940
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 ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
XavSnap
Posts: 1940
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 159 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 ...on the Facebook groupe : "Zx81 France"(fr)
Andre
Posts: 46
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 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.
Attachments
BounABplt.p
(1.06 KiB) Downloaded 136 times
BounceAB.p
(291 Bytes) Downloaded 145 times
The ZX81 pleasure is spreading, ANDRE***
http://zx81.ordi5.free.fr/andre
http://zx81.de/andre
User avatar
LoadError
Posts: 22
Joined: Thu Apr 29, 2021 12:45 pm

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

Post by LoadError »

Here is the result of my 1K ramblings. =)
Attachments
zx81dice1k.p
(698 Bytes) Downloaded 152 times
My Sinclair belongings:
- unexpanded, unmodified, unbackporched ZX81
- expanded (from 16K to 48K) rubber keyed ZX Spectrum
- a Cambridge Scientific pocket calculator
User avatar
LoadError
Posts: 22
Joined: Thu Apr 29, 2021 12:45 pm

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

Post by LoadError »

And here is the ZX80 version. :)
Attachments
zx80dice.T81
(707 Bytes) Downloaded 149 times
My Sinclair belongings:
- unexpanded, unmodified, unbackporched ZX81
- expanded (from 16K to 48K) rubber keyed ZX Spectrum
- a Cambridge Scientific pocket calculator
Post Reply