Diving into Retro Computing with the Amstrad PCW 8256#409
Diving into Retro Computing with the Amstrad PCW 8256#409csalt-scottlogic merged 1 commit intoScottLogic:gh-pagesfrom
Conversation
csalt-scottlogic
left a comment
There was a problem hiding this comment.
I think it's really interesting! One general thing that might be worth considering is to put all of the BASIC keywords in code font when they occur in normal text, instead of just in capitals.
| @@ -0,0 +1,405 @@ | |||
| --- | |||
| title: Diving into Retro Computing with the Amstrad PCW 8256 | |||
| date: 2026-02-16 10:00:00 Z | |||
There was a problem hiding this comment.
This will need changing to the publication date
| ~~~ | ||
| ... | ||
| 130 DIM words$(10) | ||
| 140 DATA “ONTO”,”PLOT”,”THAT”,”WILL”,”WITH”,”SENT”,”ABLE”,”INTO”,”WHEN”,”LIFE” |
There was a problem hiding this comment.
Your quotes have been changed to "fancy quotes" when they should be the " quotes
There was a problem hiding this comment.
I think I've changed them all now
| ### GOSUB | ||
| Instructs BASIC to jump to a particular line and execute the code thereon until it finds the RETURN statement. Cannot be parameterised. | ||
|
|
||
| ### GOTO |
There was a problem hiding this comment.
Locomotive BASIC also had a "computed GOSUB/GOTO" where you could type ON [expression] GOSUB 100,200,300... and at runtime it would compute the value of the expression, which had to have a 1-byte integer result, and then go to the nth entry in the list of line numbers.
There was a problem hiding this comment.
I noticed that in the manual, not sure if it fits into the list of function-like instructions though as to me, it seems like an extension of GOSUB where it just gets called in a different way. Do you think it's worth adding it to this list, or just including some info about ON under the GOSUB title?
There was a problem hiding this comment.
That's a good point, it kind of falls between two stools because it's effectively a switch statement as well as a way to define a function entry point. Maybe just add that there's a "computed" version that's a bit like a switch
|
|
||
| I haven't mentioned it yet, but even though we are using the RND function to grab random numbers, the game is actually the same every single time so far. The answer, the placement of the words, and the characters in between each word which are determined by BASIC's RND function are always the same. This is because BASIC's pseudo-random number generator calculates the next number based on the previously generated one, and the seed is the same every time, as well as the order in which we generate the numbers for different purposes. We can alter the seed by calling RANDOMIZE with our own number - but how do we come up with *that* number while keeping every game unique? | ||
|
|
||
| I included an initial screen to my game as a solution, where a counter counts up until the user presses a key. The counter's value is then passed to RANDOMIZE so that each game can be different: |
There was a problem hiding this comment.
The "traditional Locomotive BASIC" answer was to use RANDOMIZE TIME - the TIME keyword returns the length of time since boot. I don't know if this works in Mallard though.
There was a problem hiding this comment.
I checked the manual but don't see anything built-in that lets you grab the time :(
149ff73 to
1a1deff
Compare
1a1deff to
88bb531
Compare
Please add a direct link to your post here:
https://lhancock-scottlogic.github.io/blog/2026/02/19/diving-into-retro-computing.html
Have you (please tick each box to show completion):
npm installfollowed bynpx mdspell "**/{FILE_NAME}.md" --en-gb -a -n -x -tif that's your thing)Posts are reviewed / approved by your Regional Tech Lead.