New Applesoft BASIC game "Dobble" (AKA "Spot-it") for Apple-1 / ][

2 posts / 0 new
Last post
Offline
Last seen: 17 hours 29 min ago
Joined: May 4 2021 - 06:35
Posts: 172
New Applesoft BASIC game "Dobble" (AKA "Spot-it") for Apple-1 / ][
Dear friends,
I am following up Jader Monari's post on  RetroProgramming Italia - RP Italia (A division of RetroCampus)  FB group to share with you my personal version of the game "DOBBLE" (AKA "SPOT-IT") for Applesoft BASIC for Apple-1 ( and Apple ][ ), hoping you will enjoy it.
 
 
Basically, I have kept the card generation algorithm written by Jader and Prof. M. Ferri from University of Bologna.
All the rest has been rewritten only to have the best possible game-play, even with the notorious super slow and text-only terminal of the Apple-1.
In fact, the differences with the original C64 versions -in keyboard input and screen output- are too many for an efficient adaptation of what Jader wrote.
 
I also modified the storage of generated cards: they do not end up in the dedicated RAM area but instead they go straight into the array that is then used by the game itself.
 
Lastly, I added the possibility to choose the type of game: ‘The Towering Inferno’ or ‘The Well’, and added a page of instructions.
 
The choice of the number-symbol to be played is done by pressing the appropriate alphabetic key (a, b, c, d, e, f, g, h for player A, i, j ,k ,l ,m, n, o, p for player B): unfortunately it is not possible to have the same selection method of the C64 version.
 
I believe the final result is well playable... and fun!
 
Since the final binary file is just over 4kB long, a further downsizing for ‘native 4kB’ INTEGER Basic is not excluded. I think it's quite difficult because - after stripping out arrays and unusable ram - there are ~3kB free, but never say never... volunteers are welcome!
 
You can find everything you need on my usual repository dedicated to new games for Apple-1, but I'm quite confident that the game will run smoothly on many other different Basic:
 
 
If you like, you can also play it on the Apple emulator ][ ( http://www.sblendorio.eu/misc/jsbasic/index.htm ) provided by Francesco Sblendorio, if you don't find it in the drop-down menu list, just copy-paste-Run the .txt  source.
 
Enjoy!  :-)
 
Claudio Parmigiani - P-LAB
 
 
Offline
Last seen: 17 hours 29 min ago
Joined: May 4 2021 - 06:35
Posts: 172
Dobble/Spot-It game now available for Integer Basic 4k!

Hi all,

as “almost promised” I am pleased to share with you the 4K INTEGER BASIC version of “Dobble” (or "Spot-it"), which now runs on non-expanded Apple-1/Replicas as well.

Optimizing the program to stay within the 3456 bytes RAM available was challenging, but well worth the effort.

 

The card array in BASIC, for example, (57 cards, 8 symbols per card for a total of 456 elements) required  456*2+4=916 bytes, which was way too much.

I therefore "carved out" a small area of RAM dedicated exclusively to the cards, without conflicting with the rest of variables and program itself.

In fact, in INTEGER BASIC the actual program is stored starting from the last available RAM location going backwards, while variables -whether explicitly or implicitly declared- are stored from the first free location

onwards.

 

I also worked a bit on the pseudo-random number generator -one of the weaknesses of both INTEGER and Applesoft BASIC- because after shuffling the deck the cards always were in the same sequence.  

 

This was even more challenging since the RND function here works in its own way and there is no “seed” feature.

The solution involves randomly generating pseudo-random numbers for a variable amount of time at the beginning of each game to “move the number sequence forward.”

 

This occurs at the choice of game type: the keypress wait loop for the player's selection continues to call the RND function until a choice is made.

Thanks Francesco (as usual) for the suggestion.

 

This method also works with Applesoft BASIC, but on Apple ][ a clever trick -that uses the contents of two memory locations related to the keyboard  as initial seed- can be used.

However, in the Apple-1 variant of Applesoft BASIC this does not work because the handling of the keyboard and related events are different.

So I have adopted the same solution of INTEGER Basic and upgraded the program: update it if you have already downloaded it.

 

As always, all the material is available for download from the dedicated page:

https://p-l4b.github.io/angela/

 

 

If you want to discover more about how variables are stored in memory in INTEGER Basic, take a look here:

https://retroprogramming.it/2020/04/storage-of-variables-in-apple-1-integer-basic/

 

Enjoy! :-)

 

Claudio - P-LAB

 

 

Log in or register to post comments