update tinybasic.gmi

This commit is contained in:
lee2sman 2022-03-31 23:29:22 -04:00
parent 0036819830
commit a1470e309d
1 changed files with 8 additions and 6 deletions

View File

@ -10,7 +10,7 @@ So originally, Tiny BASIC was a specification, not an implementation. The People
> The magic of a good language is the ease with which a particular idea may be expressed. The assembly language of most microcomputers is very complex, very powerful, and very hard to learn. The Tiny BASIC project at PCC represents our attempt to give the hobbyist a more human-oriented language or notation with which to encode his programs. [2]
The newsletter goes on to describe the motivation for the project, a free implementation of the BASIC languager, and the community working on it currently. It goes on to specify what the language could entail, how to solve various probelms, a discussion on creating a compiler versus an interpreter, what it will take to build one's own Tiny BASIC, and a request for feedback and ideas. It also contained some simple BASIC games.
The newsletter goes on to describe the motivation for the project, a free implementation of the BASIC language, and the community working on it currently. It specifies what the language could entail, how to solve various problems, a discussion on creating a compiler versus an interpreter, what it will take to build one's own Tiny BASIC, and a request for feedback and ideas. It also contained some simple BASIC games.
### All Rights Wronged
@ -18,7 +18,7 @@ One of the earlier implementations was Dr. Li-Chen Wang's Palo Alto Tiny BASIC,
BASIC flourished as a language throughout the 80s and into the 90s. Many versions of BASIC proliferated, and many versions of Tiny BASIC as well, including some that grew into more extended versions, sometimes including the ability to create graphics or sound, rather than just ASCII text.
In fact, the inital Tiny BASIC implementations allowed printing text output but couldn't receive text string inputs. These were very simple implementations of BASIC, meant to emphasize simplicity and low memory usage. They allowed for (integer) variables, subroutines via gosub/return, if-statements (though not if-then or if-then-else), numerical though not char/string input, and not much else!
In fact, the inital Tiny BASIC implementations allowed printing text output but couldn't receive text string inputs. These were very simple implementations of BASIC as it had to work with low memory usage. They allowed for (integer) variables, subroutines via gosub/return, if-statements (though not if-then or if-then-else), numerical though not char/string input, and not much else!
The allowed statements were:
@ -37,7 +37,7 @@ END
Strings weren't defined in the notes, nor were "remarks" aka comments. Missing also were for-loops, random number generation, arrays, though some of the Tiny BASIC dialects did add these.
I decided to try my hand at making a simple dice gambling game. Where I grew up Threelo was a popular dice game, and my friends had our own house rules. I first implemented Pig, a good first game to program due to its minimal actions and easiness of programming. Essentially, each turn you roll a die and add the total to your points. You can stop at any time and keep that total, or keep rolling. If you ever roll a 1 you lose all the points you accrued. That's it! Pretty basic.
I decided to try my hand at making a simple dice gambling game. Where I grew up Threelo was a popular dice game, and my friends had our own house rules. But to warm up, I first implemented Pig, a good first game to program due to its minimal actions and easiness of programming. Essentially, each turn you roll a die and add the total to your points. You can stop at any time and keep that total, or keep rolling. If you ever roll a 1 you lose all the points you accrued. That's it! Pretty ....(wait for it).... basic.
I downloaded Damian Gareth Walker's Tiny BASIC Interpreter and Compiler project written in C. [3]
@ -45,16 +45,17 @@ It packages a man page and some example games (Hunt the Wumpus, Tic Tac Toe, and
Without a built-in random number generator, how was I going to create a random die roll?
Luckily, Gareth published some instructions to construct a minimal not-very-sophisticated random number generator. [4] We don't have the privilege of referencing the clock of the computer for example, so we follow early BASIC tradition and ask the user for a seed number, then perform a simple calculation. Some other implementations of Tiny BASIC came with a random number generator. Gareth's doesn't by default but does add in the ability to use REM for commenting.
Luckily, Gareth published some instructions to construct a minimal not-very-sophisticated random number generator. [4] We don't have the privilege of referencing the clock of the computer for example, so we follow early BASIC tradition and ask the user for a seed number, then perform a simple calculation. Some other implementations of Tiny BASIC came with a random number generator. Gareth's doesn't by default but does add in the ability to use REM (remark) for commenting.
### PIG
So here's my small and not terribly fun or sophisticated game of Pig. No doubt many improvements can be made.
So here's my small and not terribly fun or sophisticated game of Pig. No doubt many improvements can be made.
```
REM --- PIG Dice game test
REM --- Created: 2022-03-30
REM --- Created for TinyBASIC implemented by cyningstan/Damian Gareth Walker
REM --- Created for cyningstan's Tiny BASIC
REM --- No one will want to use this code, but consider it public domain CC0.
REM --- Variable List
REM
@ -110,6 +111,7 @@ To wrap up, I'll leave you with this WANTED ad from Volume 1, Number 1 of Dr. Do
=> http://tinybasic.cyningstan.org.uk/ Tiny BASIC Interpreter and Compiler Portal
=> http://tinybasic.cyningstan.org.uk/download/10/random-number-generator Minimal random number generator for Tiny BASIC
=> http://tinybasic.cyningstan.org.uk/download/44/kingdom-of-the-lyre Kingdom of the Lyre game
=> http://www.ittybittycomputers.com/IttyBitty/TinyBasic/TBuserMan.htm Tom Pittman's Tiny BASIC User Manual
=> ./index.gmi Back to index