OK, another review. This one is interesting for a number of reasons. I did most of the work away from home on holiday between Christmas and New Year. This proved Orwell makes a good travel computer (although he needs some help for now). It also bought up a new command for me to support. And finally I found an odd quirk in the original MS Basic. I am not sure it’s a bug or not but it’s definitely odd. But, lets start at the beginning.
- Title: Creepy Computer Games
- Subtitle: For SPECTRUM, ZX81, BBC, ORIC, VIC20, TRS-80, APPLE, DRAGON
- Authors: Several! (program editor Chris Oxlade)
- Editor: Jenny Tyler
- Pages: 16
- Published: 1983
- ISBN 10: 0860207803
- ISBN 13: 978-0860207801
This book is quite a thin one and it has 8 programs to enter, all with a ‘creepy’ theme. It jumps straight into things and there is little intro and none of the descriptions of BASIC or lists of keywords some of the other books have.
As always to avoid having large chunks of listings in these reviews I have instead made the listings available as a ZIP file here: http://www.asciimation.co.nz/UsborneBookReviews/
You will notice the beachy background behind the cover photo. This is at Ahipara, the base of (incorrectly named) Ninety Mile Beach in upper New Zealand. I was on holiday, roughing it away from garage and computer, but I was able to take Orwell with me and get him working.
The netbook is basically being used as storage. Orwell can send and receive serial commands via a USB to serial converter and a terminal emulator on the netbook. I was able to enter the programs on the netbook, store them then LOAD them into Orwell. I could then make changes and send them back to the netbook for re-saving if needed. Output was to the tellie (which works great). Unfortunately with only my phone as a camera I wasn’t able to get clear pictures of that screen so I retook the photos on my own tellie once I got home. It wasn’t until I was home I got all the programs to work anyway as you well read below.
Lets start with the first program. Computer nightmare.
This is a simple game. It’s just a random number matching one. The computer generates random numbers and you have to type them in. Nothing difficult at all. It also prints up (not very insulting) insults at you.
This wasn’t a particularly exciting start to the book. Not even worth a screenshot.
Next up we have Number Wizard. Again this is a simple random number type game but this one is a little more interesting.
The computer generates two random numbers between 1 – 9 and prints them on screen. It also prints out a list of number from 1 – 9 across the screen. You have to enter two numbers that are in that list and also that add up to the same total as the two number the computer generated. So if those numbers were 3 and 5 you need to choose two number that add up to 8 and are in the list on screen. Once you use a number it disappears from the list.
You are able to use 0 as one of your numbers which I originally thought was a bug but it is actually coded that way (and commented in the book as such).
A little more satisfying than the first game but nothing special.
Next we have Ghost Guzzler. This one proved interesting, not for the game itself which is another number matching one, but for a quirk it showed up in MS Basic.
This game generates a random number that moves across the screen towards your ghost guzzler, a ‘:’ and a number. You change this number so it matches the moving one and when that hits your guzzler it is eaten. If the numbers don’t match you lose a life.
There is nothing special in the code. But it didn’t behave correctly. Instead of the random number starting off at the left most column of the screen it started in the third one. It wasn’t till I got home I could debug why.
The line of interest is this:
120 PRINT TAB(I);N;TAB(18);”:”;Y
Where I is the position of the number. N is the number and Y is your changing number. I starts at 1.
It turns out there are two quirks in the version of MS Basic I am using. I am not sure yet if they are bugs though.
The first is the TAB command starts indexing at 0 not 1. So TAB(0) is the left most column. TAB(1) is the second column and so on.
The second is when printing a numeric value (such as N or Y above) an extra space is printed before the number.
The combination of these two quirks meant that lines of Basic starts printing in the third column across. I tested this out on a VIC20 online emulator and an online Applesoft Basic emulator, both of which use their own variation of MS Basic. The Vic emulator shows both quirks whereas the Apple one doesn’t.
Investigating the assembly code for each version does show there are differences in the code so it might be something Apple ‘fixed’ in their version of Basic. I am not sure if I will change Orwell or not yet but I think so as the printing of the space before the number seems wrong to me. The two quirks are related as it is the code that handles the printing of TABs and spaces where the differences are. I am still studying the code but I believe the issue is in how it is checking how many spaces to print and where and when it decrements the count.
Next up we have Spiderwoman.
Yet another guessing game. In this one the computer chooses a random letter then you have to guess what it is. you enter in words are are told if the letter is in your work. You can then narrow it down until you are ready to guess the letter. You only get to enter 15 words though.
The next game, Gravedigger, is a big one compared to the others but it is quite satisfying and actually quite a challenge to play.
The game draws a graveyard filled with random gravestones. You (*) move from the start to the exit in the opposite corner by specifying an N, S, E or W direction. You can’t move though walls (:) or gravestones (+) as they block your way. To make things harder three skeletons (X) are following you but you can block their way by digging holes (O). Don’t fall into your own holes though!
Visually this is an interesting game. And I haven’t actually beaten it yet!
Next up is Mad House.
This game prints three lines representing walls which have a moving door each (represented by > <). You can move the top and bottom doors left and right. The middle one moves randomly. You have to get all three to align so you can escape (indicated by a line of ‘M’ footsteps!) before a counter on the screen reaches zero.
This game threw up a command I didn’t have – PRINT AT. The lines in question are:
180 PRINT AT I,0;L$
190 PRINT AT I,P(I/5);”> <”
Different computers do this in different ways but basically it’s a command to move the cursor to a different part of the screen then print there. Orwell didn’t support this and I couldn’t add that functionality until I got home as it meant modifying the original MS Basic code and burning a new ROM.
To actually add the command I needed a new command and two values, the X and Y co-ordinates to move to. I knew the Batsocks video board supported a move command. The command you use is: <ESC>Y xy
That is actually a VT52 terminal command.
Basic didn’t have any existing command where it took two number values as input for me to copy so instead I created a new command, MOVE, that takes no parameters. Instead I created two memory locations at 0X30F and 0×310 into which you can POKE the X and Y values. The command then just reads from those locations.
So in Orwell code the lines above become:
180 POKE 783,I: POKE 784,0: MOVE: PRINT L$
190 POKE 783,I: POKE 784,P(I/5): MOVE: PRINT “> <”
Memory locations are POKEed using their decimal value hence the 783, 784.
This works very well and it is used again in a later game.
Next up is Ghost Maze.
This game creates a maze and you have to escape (and not get caught by a ghost). You can how ever only see a little of the maze in front of you and you can only move forwards or rotate left and right.
This game is OK but a little hard to play as it loops slowly and it’s a bit fiddly getting it to accept your input as it is using inkey which continuously scans for a key. So sometimes it doesn’t see your key press and other times it will see it multiple times.
The final game is called Seance.
This game also uses the PRINT AT function so I didn’t get it working until I was home and added in my MOVE command.
The game prints the letters of the alphabet arranged in a rectangle (as if the edges of a table). An asterix (*) then appears next to a letter and then and randomly moves about to be next to another letter. The number of letters and sequence is random. You have to remember the letters in the correct sequence then type them in correctly when asked.
It keeps a score and once you get enough right you win or, if you get too many wrong, you lose.
All in all this was a very good book. Some of the games are a little lame. More of the usual guess the random number/letter type but in this book they are presented in an interesting way. And it threw up some interesting problems for Orwell.
One other small thing I found was a bug in my keyboard handling code. To handle the ALPHA key (basically a caps lock key) I was checking if it was a letter key that was pressed and if so making it upper case. Only I was off by one when checking if it were the ‘z’ key. I was only checking between a-y not a-z. So the ‘z’ key wasn’t being capitalised if ALPHA was down. Not a show stopping bug as you could always SHIFT it to uppercase it but good to find and fix.
Finally on the back cover of the book it lists some others in the Usborne computer series:
- Usborne Guide to Computers
- Understanding the Micro
- Computer Programming
- Computer and Video Games
- Computer Spacegames
- Computer Battlegames
- Practical Things to do with a Microcomputer
- Computer Jargon
- Computer Graphics
- Write Your Own Adventure Programs
- Machine Code for Beginners
- Better BASIC
- Inside the Chip
All of these book I now have and I have linked to the ones I have already reviewed. There are lots more to come. And I only have one more book (Computer Spy Games) to get to complete my collection!
One final little interesting bit of information. That beach I was on is actually a public highway. So it is perfectly legal to drive on the beach!
I decided it was time for Orwell to progress past the breadboard stage. The Usborne reviews are going well. I have added in a silent LOAD mode where character aren’t echoed to the screen which speeds things up a lot. So now the LOAD command is silent and I added a ECHOLOAD command that echoes everything to the screen.
Then I decided Orwell needs a new board. I’ve been drawing out the schematic in Eagle so I can have a PCB made but first I decided to transfer him from breadboard to Veroboard. Not a massive improvement but it meant I could build the board using the schematic as a reference and therefore find any mistakes in it.
Veroboard, or strip board, is commonly used for prototyping. I use it a lot myself. For simple circuits you use the strips themselves and the odd link across them. Orwell though needs a lot of links so I use a free wiring technique. I put all the components on the board then mark out where the track breaks need to be.
I then drill all the breaks. You can do this by hand but Orwell needed something like 300+ breaks so I set up the pillar drill and used a centre drill to break the tracks. Using the drill I can set the depth and get all the breaks nice.
With the holes drilled I then soldered in all the sockets and components. I added decoupling caps, some of which pass though the track breaks.
I then start adding wires. Now I don’t recommend this technique. I use enamelled copper wire to make all the links (the kind you can burn the enamel off with the soldering iron) and I use long loops since there are so many connections you will need to move them later to make others. You have to be really careful not to bend the wires so much they break or not to scratch off the insulation on the tops of the pins which will cause shorts. This does happen but I explain how to fix it later. I start wiring on one side of the board, the left, and work across to the right. A little thought is needed to work out which wires to do first so you still have access to the board to do later wires.
I do all the power wires first and then tested the board and measured all the power pins. I then add the rest of the wires. Bloody hundreds of them!
The video board is bolted to the Veroboard and I used mica washers under the nuts to make sure they didn’t short out the tracks.
With all the wiring done (and VERY well checked) I powered up the board. I found there were a few wires I had missed. I would normally print out the schematic and tick off the wires as I add them but my printer died so I couldn’t do this. I also found one short where a wire had lost it’s insulation and pressing on the board caused a short. I figured out which wire it was by prodding about with a wooden toothpick then fixed the insulation with clear nail varnish.
I also made a display board with 8 red LEDs which hang off the debug port and a green LED to indicate power. There was some discussing on whether the debug LEDs should be red of green but as my friend Grant pointed out it’s an 80s computer and KITT was in the 80s and those were red LEDS. I figured yeah, so were Cylons so I went with red too.
It then worked perfectly although I spent a lot of time debugging an issue where the LEDs wouldn’t stay lit. I checked all the hardware many times over before realising it was a software bug. I was using a ROM build that was using the LEDS for other debugging so they were being cleared.
With everything working (I left it running a Larson scanner routine for days) so I started making a base plate for the board so the wires couldn’t move or be damaged. I used some aluminium and made a base plate. The middle of the sides fold over to grip the board (which tends to bow) and I use small plates on the inside attached by 3mm machine screws to hold the board up.
The board is held up by 12mm standoffs I machined up from old chopping boards. The middle supports hold the board steady when plugging in the cables.
So now Orwell has a nice, slightly better than breadboard, circuit board and he is working well. Much neater on my computer desk too.
So next would be a proper board which I will work on but for now Orwell is working well.
And I just found one of the hard to find Usborne books on eBay so soon I hope to have a whole set so I can complete all my reviews.
Another review, this time one with lots of code to test out. This time we’re doing Computer Battlegames.
- Title: Computer Battlegames
- Subtitle: For ZX Spectrum, ZX81, BBC, TRS-80, Apple, VIC & PET.
- Authors: Daniel Isaaman and Jenny Tyler
- Pages: 48
- Published: 1982
- ISBN 10: 0860206858
- ISBN 13: 978-0860206859
This book is full of BASIC programs to be entered, 13 in all, although the last one involves graphics and there are separate listings for each computer for that one.
After a quick double page introduction to the book and comments about entering, debugging and running the programs we jump straight into them.
To avoid having large chunks of listings in these reviews I have instead made the listing available as a ZIP file here:
The first listing…
Apparently the humans are at war with the robots! Not the friendly ones who teach us how to code in these books I hope? This program is very simple. It just chooses a random letter then you have 4 guesses to find out what it is with the computer telling you if the guess is before or after the letter.
Nothing hard to do here although all these listings are for the ZX81 with modifications for all the other machines. unfortunately the ZX81 doesn’t use standard ASCII codes so in all these listings whenever an ZX81 code is used you have to change the code used in the listing to the proper ASCII value.
Throughout the book the listings are marked with little symbols next to some lines. These indicate the lines that are different on different machines.
The Vital Message.
Next up we have The Vital Message. This is another very simple game. It creates a list of random letters that you have to then enter in. Apparently all it takes to stop a war is entering in the proper simple code. This game uses the CLS command to clear the screen after displaying the code to you so you must remember it then type it in correctly.
Next up we have Shootout. This one was interesting because on line 110 I hit a command Orwell didn’t support. That is the INKEY$ command. Unlike INPUT which waits for you to enter some keys and then hit return the INKEY$ command checks immediately if any key is being pressed on the keyboard. I had to add that functionality into MS Basic running on Orwell.
Since INKEY$ is a function (although it needs no user input) I basically copied how the CHR$ function was done in the code. It has to be a function since INKEY$ needs to return a value. Being a function you do have to specify an input parameter even though it isn’t actually used.
MS Basic doesn’t seem to handle empty strings as you would expect. If you enter a command like A$ = “” then try to compare A$ with “” it doesn’t return true. If you try to get the ASCII value of it with ASC() you get an error. Getting the length with LEN() will return 0. I did try creating an empty string in the code if no key was pressed but that seemed to cause issues so my INKEY$ function will always create a 1 character string (as does CHR$()).
So my INKEY$ will always return a length of 1 and, if no key is pressed, an ASCII value of 0.
Since I can’t seem to do a comparison against an empty string directly the way to check if a key is pressed is to look at the ASCII value and see if it is non zero:
IF ASC(INKEY$(0)) <> 0 THEN a key is pressed….
That seems to work very well.
Desert Tank Battle.
Next we have a game that uses some of the maths functions, namely SIN and ABS. Again a simple little game that worked first time. It is another of the enter some values and it tells you how close you are games.
Battle at Traitor’s castle.
Now this game proved interesting. There is a bug in the listing! Line 130 is supposed to check if the key you pressed matches the position of the O character in a line of dots (battlements – these games need some imagination). The code reads:
130 IF VAL (“O”+I$) = T THEN GOTO 170.
I$ is the key returned from INKEY$. T is the position of the O. VAL() returns a numeric value of a string. So if you press the “1″ key it returns 1 as a number. Why they had “O” in the VAL I don’t know.
This one was interesting. There isn’t anything new here but it was this listing that showed up the bug in my INKEY$ function when trying to return a zero length string. It’s interesting to note the previous listing also used INKEY$ but that worked. This one didn’t and it’s something to do with the fact that INKEY$ is called in a loop. After the first time through the loop the P$ variable was being overwritten (I think) and so was lost. P$ is the random letter the code was generating to represent a robot to ‘shoot’ by matching it with a key press. I don’t fully understand why it broke yet but it works now.
It’s tricky to take a photo of this game as what it does is display a random letter in a random spot on the screen which you have to match. It clears the screen between each one.
Next up is secret weapon. Not much to say about this one. It’s another guess the values one but with two values. It tells you if you are close or not. This code is my first use of the SQR() function.
This is another guess the random number type game. Nothing special here.
This game is a little more interesting as you have to match speed and distance in real time. It keeps looping reading your input and showing you the effect. You press keys adjusting your position until leven then you fire. It clears the screen between updates so there isn’t much to photograph!
This game is a little different and it uses dimensioned arrays. It randomly generates targets and you press the appropriate key to bomb the correct target. It uses a reverse FOR loop to count down and reduce the time you have between goes as the game progresses.
This game uses a 2 dimensional array. It draws a simple grid and you maneuver about inside it trying to get an enemy ship, that always moves directly toward you, to crash into an iceberg. Asterixis represent icebergs. As the book says, strangely the enemy ship can see you but not these whacking great icebergs in front of it. I think perhaps it is better to think of the * as mines it doesn’t know about that you are trying to get it to crash into.
There are actually some un-winnable start positions in this game as the one above shows. You (Y for you) can only move in four directions but they (Z for ‘ze robots’?) can move in eight so can get you on the diagonals. This is however one of the better games in the book.
The Wizard’s Wall.
This game was a bit more typing. Mainly all the bloody text of the instructions! It is the first game in the book to use GOSUBs. Again it is really just a guess the numbers type thing but it uses some tricky maths to spice things up a bit. Being so big (almost 2.5k!) it took some time for me to load the game in since I echo all the loading to the screen which really slows things down. I have started working on a silent load function which should be much faster.
The final game in the book is different to all the rest as it uses graphics (well, simple ones). There are separate listings for each computer. Unfortunately Orwell doesn’t support graphics (yet!) so this one will have to wait until then.
Finally the book gives some tips on adding to the programs as well as information on writing your own. Then if has a fairly good summary of BASIC commands. We then have an ASCII chart (and a ZX81 chart with it’s silly values).
There is also this handy conversion chart for the different versions of Basic each machine uses.
Finally we have answers to some of the questions and puzzles asked in the book along with snippets of code for some of them. We also have a further reading section as a lot of these books do. The books mentioned are:
- Usborne Guide to Computers by Brian Reffin Smith, Usborne.
- Understanding the Micro by Judy Tatchell and Bill Bennett, Usborne
- Introduction to Computer Programming by Brian Reffin Smith, Usborne
- Illustrating Basic by Donald Alcock, Cambridge University Press
- Fred learns about Computers by MacDonald and Evans
- The Computer Book by Robin Bradbeer et al, BBC Publications
This was a fun book. Most of the programs are quick to enter but there are a lot of guess the number type ones. It will be interesting to see if it’s companion book, Computer Spacegames, is similar.
From Orwell’s point of view it was good since we got a new command implemented (INKEY$) and I learnt a little more about the internals of MS Basic. It also showed the need for a faster loading function with the longer programs which I shall continue to work on now.
Here we have another review of one of the 80s Usborne computer books. This time we’ll learn about computer programming.
- Title: Introduction to Computer Programming
- Subtitle: A guide for absolute beginners
- Author: Brian Reffin Smith
- Editor: Lisa Watts
- Pages: 48
- Published: 1982
- ISBN 10: 0860206750
- ISBN 13: 978-0860206750
This book, another of the early ones, is another I remember fondly. I am pretty sure I had this one and seem to remember using it to learn Basic before I even had a computer (as it says on the cover no computer needed)!
The first pages explains how the book is a guide for absolute beginners and it details how Basic keywords will be introduced one at a time. It mentions that there are puzzle programs to solve and suggestions for programs to write and useful alterations to the given programs to try.
Of course I will be using my Orwell computer to test out the programs in the book. If you read my last review on the Usborne Guide to Understanding the Micro you’ll remember I found Orwell didn’t support the Basic CLS command to clear the screen. I’ve now added that command to Basic.
The first page in the book is a double page showing the very basics of how a computer works. Once again we see the cartoon robots that appear in many of these earlier Usborne books.
The next set of pages talk about how we give the computer instructions and a little about computer languages. It mentions BASIC, Pascal and PILOT as example languages. Basic I know of course. Pascall is the language I was taught at university during my degree. PILOT I have never seen anywhere and I have no idea if this language is even used anymore!
Next we learn about writing programs. There is an example here about how the computer needs precise instructions to work correctly. There was a similar example in the last book as well.
There is an interesting comment right at the end of the second page where they discuss bugs. It says ‘Sometimes, a bug makes a program produce a slightly different result which you may prefer. Useful bugs like this are called “pugs”.’
That’s certainly not a term I have ever heard used! Although I have often heard developers saying ‘that’s not a bug, it’s a feature’!
Finally we get onto our first words in Basic: PRINT, RUN and INPUT. These pages are all about using PRINT. I tested out the first program.
Hmm, doesn’t look like theirs. The next few boxes describe debugging the code. Interestingly the debugging example shows a different line 50. It has extra spaces in it. It describes how with Basic you can retype a line to replace it.
Next we learn about some more Basic keywords and variables. We learn about the LET command (which is actually optional in Microsoft Basic) as well as the READ and DATA commands. I tried the simple READ/DATA example code.
That’s the first time I tested the READ and DATA keywords on Orwell.
The next page talks about the INPUT keyword and we have another example program to try. I am manually entering these programs on Orwell itself and this one is worth saving.
The next page describes a little more about PRINT and how you can modify how the printing with a semicolon or a comma. The semicolon I knew about but I must have forgotten all about the comma which has the same effect as doing a TAB really. On Orwell with it’s Microsoft Basic the comma inserts 3 spaces.
We also learn a little about doing sums on the computer. I tested out all the commands shown and they all work on Orwell.
Next we learn about doing comparisons. We have a number of little programs to enter here. I remember being 9 and writing my own variants of a lot of these little sample programs in a small book I made. I didn’t enter these into Orwell as there is nothing new here and because on the next page we get our first decent program to try! I typed this one in on my PC and used the LOAD command to get it into Orwell.
10 PRINT "ALIEN'S SQUARE ALONG" 20 INPUT A 30 PRINT "ALIEN'S SQUARE UP" 40 INPUT B 50 CLS 60 PRINT "COMMANDO'S SQUARE ALONG" 70 INPUT C 80 PRINT "COMMANDO'S SQUARE UP" 90 INPUT D 100 CLS 110 LET X=SQR((A-C)*(A-C)+(B-D)*(B-D)) 120 PRINT "YOU ARE NOW" 130 PRINT X;"SPACE UNITS APART" 140 IF X<1.5 THEN PRINT "ALIEN FOUND" 150 IF X<1.5 THEN STOP 160 GOTO 10 170 END
That one worked perfectly although it is a little boring. We also have a program designed to make the computer look clever. Lets try this one too.
5 LET C=0 10 PRINT "I WOULD LIKE TO TALK TO YOU" 20 INPUT "TELL ME ANYTHING SILLY THAT HAPPENED TO YOU THIS WEEK";A$ 30 READ B$ 40 PRINT B$; 50 INPUT C$ 60 LET C=C+1 70 IF C=6 THEN GOTO 100 80 GOTO 30 90 DATA WHY, WHY IS THAT 95 DATA WHY, CAN YOU EXPLAIN 98 DATA CAN YOU SAY WHY, WHAT WAS THE REASON 100 PRINT "SO THE REASON YOU TYPED" 110 PRINT " ";A$ 120 PRINT "WAS REALLY GIVEN BY YOUR ANSWER" 130 PRINT " ";C$ 140 PRINT "HOW ODD!" 150 PRINT "RUN ME AGAIN FOR FURTHER ENLIGHTENMENT" 160 END
Again I used the LOAD command to get this one running and it ran first time. I used to have a colleague who you’d have conversations like that with in the lunch room. Although the final conclusion would usually happen 10 minutes after you’d finished the rest of the conversation and everyone else had moved onto other things!
The next page is all about drawing pictures. As Orwell has no graphics mode (yet) I skipped this. We then go onto a page describing how the RND function works and there is another example program to try.
10 LET C=0 20 LET A=INT(RND(1)*20+1) 30 LET B=INT(RND(1)*20+1) 40 PRINT "ALIEN SHIP'S CODES" 45 PRINT "ARE ";A,B;"FIRE" 50 INPUT X 60 LET C=C+1 70 IF X=A*B THEN PRINT "ALIEN SHIP DESTROYED" 80 IF X<>A*B THEN PRINT "MISSED" 90 IF C<6 THEN GOTO 20 100 END
That one is just a simple multiplication program really but that too worked first time. The next page discusses loops and it has a simple program to test if RND really works. I tried that one as well.
10 FOR I=1 TO 1000 20 LET R=INT(RND(1)*6+1) 30 IF R=1 THEN LET A=A+1 40 IF R=2 THEN LET B=B+1 50 IF R=3 THEN LET C=C+1 60 IF R=4 THEN LET D=D+1 70 IF R=5 THEN LET E=E+1 80 IF R=6 THEN LET F=F+1 90 NEXT I 100 PRINT "FINISHED" 110 PRINT A, B, C 120 PRINT D, E, F 130 END
That one does take a while to run but run it did!
Next we learn about subroutines with a few more interesting little programs to try and we then go on to learn about some string manipulation commands. I tested these on Orwell and they all worked fine. Then we have a code maker program.
5 LET C$="" 7 LET D$="" 10 PRINT "TYPE IN A SHORT MESSAGE" 20 INPUT M$ 30 PRINT "NOW TYPE IN A SECRET NUMBER BETWEEN 1 AND ";LEN(M$)-1 40 INPUT N 50 LET A$=RIGHT$(M$,N) 60 LET B$=LEFT$(M$,LEN(M$)-N) 70 LET M$=A$+B$ 80 FOR I=1 TO LEN(M$) STEP 2 90 LET C$=C$+MID$(M$,I,1) 100 NEXT I 110 FOR J=2 TO LEN(M$) STEP 2 120 LET D$=D$+MID$(M$,J,1) 130 NEXT J 140 LET M$=C$+D$ 150 PRINT "CODED MESSAGE IS" 160 PRINT M$ 170 END
That one worked as well! Next we have some more code to try. One involves plotting lines which I can’t do yet. The other is a birthdays program where it tallies birthdays against months. We then have another page about graphics again.
Next we get to something that looks familiar. The funny poems program. This was something we saw in the Usborne Guide to Computers and I actually made the paper version of this.
Here we have four pages that explain how to make a Basic version of the same thing. The last page has the complete listing which of course I had to try out. I actually had a couple of bugs in this one involving the commas in the DATA statements but with those sorted out it works fine.
The next page is one with programming tips and it actually mentions this bug there.
Finally the book has the answers to the puzzles asked throughout it and then a summary of the BASIC keywords used in the book and a glossary of computer terms. And, like one of the previous books, there is a list of titles for further reading.
- Usborne Guide to Computers by Brian Reffin Smith, Usborne 1981
- Understanding the Micro by Judy Tatchell and Bill Bennett, Usborne 1982
- The Computer Book by Robin Bradbeer, Peter DeBono and Peter Laurie, BBC 1982
- Illustrating Computers by Colin Day and Donald Alcock, Pan 1982
- Illustrating BASIC by Donald Alcock, Cambridge University Press 1977
- Computer Spacegames by Daniel Isaaman and Jenny Tyler, Usborne 1982
- Computer Battlegames by Daniel Isaaman and Jenny Tyler, Usborne 1982
The latter two I shall review myself soon.
All in all I found this book to be a great introduction to Basic. It describes a lot of the basic concepts of programming and in a fun way. You really don’t need a computer to use this book (and I am sure I didn’t when I first read it) but it is much more fun if you do have one!
Well, after finally making some (painful) progress on Orwell it is time to do another review on one of my stack of Usborne books. This book includes some actual Basic programs to try and Orwell should be up to the task now.
- Title: Usborne Guide to Understanding the Micro
- Subtitle: How it works and what it can do
- Author: Judy Tatchell and Bill Bennett
- Editor: Lisa Watts
- Pages: 48
- Published: 1982
- ISBN 10: 0860206378
- ISBN 13: 978-0860206378
This book is another of the earlier Usborne books. I remember I must have owned this one or else borrowed it a lot from the library as I can distinctly remember much of it. It’s one of the ones with the hand drawn cartoon robots to explain everything. This actual copy seems brand new. In fact it is tricky getting the pages sitting flat enough to photograph. The spine hasn’t been bent at all.
According to the first page this book is for anyone who wants to know about microcomputers. It explains how to use a micro, how to program one then how they work. It talks about how micros can be linked to other computers to bring all sorts of information into your home. It discusses things you can add to your micro then finally it has a handy, up to date, buyers guide.
First we meet the micro.
This gives a handy guide for setting up the machine. It shows the leads required and how you connect it to a tellie for output. I guess the ZAP isn’t meant to mean from the (UK) mains plug! Apparently all the important parts of the micro should be kept inside the keyboard. Seems I am doing that bit wrong at the moment (but am working on it).
Next we jump straight into programming. That’s interesting since I think the first thing almost everyone did after setting up their new micro was use it to play games!
We get to see the robots here. They are often used in the Usborne computer books. In this case it is illustrating how you tell a computer what to do. Actually in this specific case it shows how you have to be very precise about telling a computer what to do. That list of specs in box 1 however is still a better specification than a lot I have seen!
On the facing page we have some weird, two headed robot/computer/vacuum cleaner type thing showing the different types of memory in a computer, RAM and ROM. The memory size sphere reminds me a lot of the Zeroids from the Terrahawks!
Next we look at the keyboard more closely including instructions on how to use the shift key! We then look at where to get programs for micros. According to this page listings in magazines are often not well tested and may contain bugs. Also on this page it mentions Viewdata or Prestel terminals. Viewdata was a kind of forerunner to the WWW. It was a way of displaying pages of information brought down by a modem. The pages were very similar to Teletext pages (where the data was broadcast with the TV signals).
When first building Orwell I actually bought a Viewdata terminal with a view to using it’s keyboard. When I picked it up however I found it was new and completely unused. It didn’t even have a mains plug wired to it yet. I fired it up and it actually works perfectly so I can’t bring myself to destroy it. Of course these days there is nothing for me to connect to with it which is sad but apparently I can use it to create my very own Viewdata pages if I so desire!
Although, somewhat amazingly, Viewdata is still apparently used in the UK by travel agents. I even found an online course where, for a mere 199 UK pounds, you can do a 6 month course on how to use it!
After that shocking revelation we finally get to the good stuff. Writing our own programs!
There are two programs on these pages. I will enter in both and see if I can get them to run on Orwell. Finally his purpose is revealed! The first program is the sort of thing used by the NSA. A program used to keep spies from infiltrating a secret society (what about sys-admins though?). Below is the actual code:
10 PRINT "TELL ME THE PASSWORD, CHIEF." 20 INPUT P$ 30 CLS 40 PRINT "HALT! WHAT IS THE PASSWORD?" 50 PRINT "YOU CAN HAVE TWO TRIES." 60 FOR A = 1 TO 2 70 INPUT A$ 80 IF A$=P$ THEN A=2:GOTO 130 90 PRINT "WRONG." 100 NEXT A 110 PRINT "OUT! YOU MUST BE A SPY!" 120 END 130 PRINT "ENTER, FRIEND." 140 END
Ah, now immediately I see a problem. The CLS command isn’t supported by Orwell. In fact I have no clear screen command. Technically I can do it though. By sending the appropriate escape codes to the Batsocks video generator I can do all sorts of cool terminal emulation things. But I have no way of entering and sending those codes yet. I need to add that command to Basic (which I imagine will take some working out). But lets continue on with line 30 removed for now. For these reviews I will list the programs as they appear in the books.
To load this code into Orwell I simple store it as a text file then enter load mode on the machine (by typing LOAD). It will then accept input over the serial line. I can then use Realterm (terminal emulator software) to send it to Orwell. I use Realterm as I can specify the speed I send the characters. By that I mean the rate they are sent not the actual serial speed (which is 19200 baud). If you read my debugging stories you’ll see why that’s necessary.
OK, I entered the code and loaded it into Orwell.
Then I tried running it. I had completely forgotten that Basic programs are interpreted. That means they get executed a line at a time and the machine works out what to do on each line. This means despite knowing I don’t support the CLS command the program can still be run. It runs happily until it gets to line 30 when the interpreter spits out an error. In this case an SN ERROR or syntax error. Orwell doesn’t understand that command (yet).
I removed that line of code and tried again.
Success! It actually works (apart from the clear screen). My first program entered from an 80s Usborne book on my hand made 80s computer! Onwards and upwards.
The second program is called SPLASH GAME.
10 PRINT "SPLASH GAME" 20 PRINT 30 PRINT "THE STEERING ON THE" 40 PRINT "GOKART HAS FAILED AND" 50 PRINT "YOU ARE HEADING FOR THE" 60 PRINT "DUCKPOND. YOU MUST" 70 PRINT "PRESS THE RIGHT LETTER" 80 PRINT "TO WORK THE BRAKES." 90 PRINT "YOU HAVE 5 CHANCES." 100 LET C$=CHR$(64+INT(RND(1)*26+1)) 110 FOR G = 1 TO 5 120 INPUT G$ 130 IF G$=C$ THEN G=5:GOTO 190 140 IF G$<C$ THEN PRINT "AFTER"; 150 IF G$>C$ THEN PRINT "BEFORE"; 160 PRINT G$ 170 NEXT G 180 PRINT "SPLAAAAAAASH" 190 PRINT "YOU HAVE GOT WET." 200 END 210 PRINT "SCREEEEEEEECH..." 220 PRINT "YOU STOPPED IN TIME." 230 END
Interesting line 100 gives Orwell some trouble. Not the actual code itself, that’s perfectly valid Orwell Basic, but the speed the line is sent. Or rather the speed the following line is sent.
The way Microsoft Basic works is it reads characters into an input buffer until it receives a CR (carriage return). It then processes the entire line. A line like line 100 above takes Basic a little while to process. If there isn’t enough time to process the line characters from the next line can be missed. So unless I made the delays between lines long enough I was missing characters and getting errors. In the end I used 30mS between characters and 30mS between lines. That means a small program like that above takes 24 seconds to load! I really am living like in the 80s!
Anyway, lets see if it runs now.
Well that works. Although there are a couple of bugs in this code! One is obvious if you read the listing carefully. The other, minor one, is there needs to be a space after the “BEFORE” and “AFTER” text. The semicolon after the PRINT means the next PRINT will be on the same line so a space is needed. The second error is the GOTO line number if you choose the right letter. If you choose the right thing it says you got wet. The line number should be 210 and not 190.
Now the next page shows what I just did. Typing in listings and loading. There is also a section on bugs in programs. They should have done that page first! We do however have a third program to enter – Crocodiles.
10 PRINT "HOW MANY CROCODILES IN THE RIVER"? 20 PRINT "YOU HAVE FIVE GUESSES." 30 LET A=6 40 FOR N=1 TO 5 50 INPUT G 60 IF G=A THEN N=5:GOTO 120 70 PRINT "WRONG" 80 NEXT N 90 PRINT "SNAP! YOU HAVE BEEN EATEN UP!" 100 END 110 PRINT "RIGHT. NOW PADDLE AWAY FAST!" 120 END
Obviously a simple little program. Amazingly with the same bug as the previous one! The wrong GOTO line number. Ironic on a page about finding bugs in programs. Especially given that’s one of the lines shown with a bug in it on the drawing and the listing is the ‘correct’ version. Perhaps it was a trick question? It’s not a bug, it’s a feature!
Next the book talks about saving programs. It shows cassette recorders and floppy disks but they really are floppies, 5 1/4s by the looks of it. I still have some somewhere actually. With old Doom levels I created on them!
The next page is about graphics. Although there is another error! The page title is wrong, it should say “Micro Pictures”. This page mentions things such as graphics tablets and light pens. A light pen is not something I ever owned but they always fascinated me. Of course that’s something from the era of CRT screens.
The next page is actually about micro sound. There is a little information here about making music and playing sounds. Also a little discussion on computers talking and recognising speech. Apparently only a computer with a huge amount of memory can store enough information to recognise speech.
Next the book talks about what’s inside the keyboard. The picture seems to be the insides of a Sinclair ZX81. It also mentions more powerful computers such as mainframes and minicomputers. Of course we learned about those in the Usborne Guide to Computers book.
The book then talks about what’s inside the chip. It shows how chips are made from silicon (it’s wafer thin) and some other used of microprocessors. It then goes on to describe counting in binary and how simple logic gates work. It always struck me as a very organic looking diagram for the logic flow.
From there we get a very brief look at how memory inside the computer works and such things as PEEK and POKE. The level of information is interesting as I am sure I didn’t get most of this stuff as a kid. It really just introduces the concepts but you’d need to study more to really grasp it all. Perhaps the later books will explain!
Next we get a little history of the micro starting with valve based machines such as ENIAC then onto transistors and finally microchips.
The next page is interesting as it talks about “Computer chains”. Networking is what we’d call it now. Of course all of this is pre World Wide Web. The Internet itself seems to have been created about the time this book was published but it would not have been widely know about then I imagine. Nor would people imagine what it would become.
I like the comment about doing shopping by computer and how in the future you probably will. The future is now! The page also mentioned eMail although it doesn’t call it that.
The next page talks about micros controlling things. Apparently I can control a model railway with one (if I can get that “Computer model controllers” book that’s missing from my collection) as well as controlling robots. It makes me sad though to see this page talking about how the Space Shuttle uses a micro computer similar to a home computer. The shuttle era has now passed of course.
After a page talking about things to add to your computer (disk drives, printers, joysticks and paddles and so forth) we get to the good bit. A buyers guide of some of the main home computers ‘currently’ available. They are listed in order of price and are as follows below. Each has some specs and some comments along side.
- ZX81 (Sinclair)
- ZX Spectrum (Sinclair)
- PC1500 (Sharp)
- VIC 20 (Commodore)
- TI-99/4 (Texas Instruments)
- Dragon (Dragon Data)
- Atari 400 (Atari)
- TRS-80 Colour Computer (Tandy or Radio Shack in the U.S.A.)
- Atom (acorn)
- BBC Micro (Acorn)
- PET (Commodore)
- Apple II Plus (Apple)
After a short glossary the book ends.
All in all a good little book. It packs a lot in although it doesn’t get into much depth. It’s quite amusing that 2 of the 3 program listings in the book have bugs in them. Especially the one on the page about debugging! Hopefully the books of actual programs will be better.
And I found I need to work on some extra Orwell commands such as CLS. This will probably become necessary in the later books as the programs get more complicated (and less buggy I hope).