"Angela Game" porting from Olivetti Programma 101 to Applesoft Basic

3 posts / 0 new
Last post
Offline
Last seen: 4 hours 48 min ago
Joined: May 4 2021 - 06:35
Posts: 169
"Angela Game" porting from Olivetti Programma 101 to Applesoft Basic
Dear friends,
I am pleased to share a new entry in the software library for Apple-1, but not only: it's the porting of the very famous ANGELA GAME, originally written for Olivetti Programma 101.
 
This game, simple and amusing but very difficult, became extremely popular at BEMA in New York in 1965, where our beloved P101 was introduced for the first time.
 
The rules are simple:
- You set a number to reach (goal)
- You choose a number from 1 to 6
- The computer does the same
- The numbers are added up and they contribute to the approach to the goal
- You cannot play the same number as your opponent nor its complement to 7 (e.g. 1/6, 2/5, 3/4)
- whoever exactly reaches the goal with his (valid) number, or forces the opponent to exceed it, wins.
 
The porting was not a walk in the park,my friend  Francesco Sblendorio  and I started from the QuickBasic version of the code, which was taken from an even earlier Java version (link to resources in the video description), and initially we thought/wanted it to work on the notorious INTEGER BASIC.
However, the unexpanded Apple-1 has only up to 3.5 kB of user RAM for BASIC, and unfortunately the program is bigger.
On top of that, it handles a maximum of 8 levels of GOSUB nesting, which, given the complexity of the code, is certainly not enough.
And, of course, it doesn't even handle decimal numbers but only integers, as we all know.
 
The choice therefore shifted to Applesoft Basic for Apple-1, the same as Apple ][ except for the graphics instructions.
It’s fully supported by microSDcard and CFFA1, it’s more complete and provide more than 22 kB of RAM to play with.
Unfortunately, it doesn't support the if..then..else construct either, but only the classic if..then, and this required some code maquillage.
It also does not implement the MOD function, and doesn’t even give any error when it encounters it: this almost caused me a headache...
 
The program is also complicated because it emulates all the internal registers of the P101. On request it’s possible to display them to see how many iterations are necessary to produce a result.
 
And since there was plenty of RAM, I also added:
- a page of instructions.
- a page of Credits for the original development team (I assume Perotto/Garziera/De Sandre) and for Claudio Larini – thank you, sir - without whose porting to QB this project would not have been possible.
If there are any updates on the composition of the development team or on the history of the game, I will update all the material.
 
The code is not exactly spic-and-span, I know. There are, here and there, a few REMs that I needed during refactoring to get rid of ELSEs.
In the end, the program should be written in such a BASIC way (no pun intended) that it should run with practically any BASIC interpreter...
 
My zipped online program archive has already been updated with this new program (directory /ASOFT).
 
What can I say then: play it, try to beat the machine and you will soon realize that... it's not that simple!
 
 
[all links to sources and sources in video description].
 
Enjoy! :-)
 
Claudio - P-LAB
Offline
Last seen: 4 months 1 week ago
Joined: Feb 18 2020 - 16:59
Posts: 46
Interesting!

The game seems to be similar to a "Subtraction Game", but using addition instead. Plus the added constraints of not being able to play the previous number or its complement.

  

There's obviously a mathematical strategy for the best play. I'll have to dig through your BASIC listing to figure out what it is. :-)

Offline
Last seen: 4 hours 48 min ago
Joined: May 4 2021 - 06:35
Posts: 169
Great!Remember that if you

Great!

Remember that if you want the program to make the first move, you have to enter 0 as your first move!

 

Enjoy! :-)

 

Log in or register to post comments