Electron User 1.08 ================== Chaser ------ By Peter Mitchell and James McPherson Ever had one of those days when you seem to have done nothing but chase your tail? Well now you have a chance to chase someone else's tail in this two player game for your Electron. All the instructions are in the listing. You'll find it easy to learn and fun to play. So type it in and get chasing. Main Variables X1% & Y1% Coordinates of player one's arrow X2% & Y2% Coordinates of player two's arrow C1% Player one's arrow character C2% Player two's arrow character X3% & Y3% Direction of player one's arrow X4% & Y4% Direction of player two's arrow SO% Pitch of background sound G% Number of wins player one has had H% Number of wins player two has had Lines Definition 30 Defines sound envelope 1 50 Gets rid of flashing cursor 60 Defines foreground and background colours for introduction 80 Calls procedure intro 90-120 Selects mode and gets rid of flashing cursor. Selects a colour 130-160 Defines arrow characters 170-210 Defines variables 220 Joins text and graphics cursor 260-330 Checks keys to see if they are being pressed 340-370 Alters main variables 380-450 Prints arrows and checks if there is an obstruction in their way 460-500 Moves background sound increase in pitch as time goes on 540-620 When called this procedure will play the notes in W$ in order and each note will have a length of L%. For example, typing PROCs("ABCD",4) will make the computer play an A, B, C and D in order. 650-700 Checks if player one cannot move 730-820 If player two's arrow arrives at an obstruction, tells computer which way arrow can go 850-920 Checks if player two cannot move 930-1020 If player one's arrow arrives at an obstruction, tells computer which way arrow can go. 1050-1090 Checks to see if it is a draw 1130-1140 Prints who has won 1150 Defines notes for "For He's A Jolly Good Fellow" 1160-1230 Adds to relevant player's score 1260-1640 Prepares computer for starting new game 1780-1910 Prints players' scoresFRUIT MACHINEFruit Machine turns your Electron into a one-armed bandit. You start out with £1 and each spin costs you 10p. Are you a winner or a loser? Play the Electron Fruit Machine and see.     Procedures PROCINIT Sets up the envelopes, defines the characters and displays the winning combinations and the game status PROCSET Draws the fruit machine's outline and prints the relevant text inside it PROCPOS Works out the starting point for the drum PROCSPIN Spins the drum PROCPAY_OUT Pays out the money with the appropriate sounds PROCJACKPOT Pays out the jackpot with the appropriate sound and working PROCBROKE Tells you when all your money has gone and asks if you want another go PROCDEBT Tells you how much money you have in negative form "You have -20p left") and then asks if you want another goMATHS HIKE By Pete Bibby Once upon a time, many years ago when I was in primary school, our class had a maths teacher who used to take us on "Mathematical Hikes". Of course we never left the classroom. What he meant was that he'd take us on a tour of our powers of mental arithmetic. He would tell us the first number of the hike - suppose it was 5 - and say "Multiply it by 2". Then he'd say something like "Now add 7 to the total and multiply the result by 6". When he thought he'd gone far enough he'd ask us the answer, which in this case is 102. Occasionally he'd carry on until only one or two of us could keep the total in our heads. Going on mathematical hikes really made mental arithmetic interesting. Of course you don't need a teacher to take you on mathematical hikes when you've got an Electron. Just type in this program and your micro will play the part of the teacher. And it won't keep you in after school! Have fun. RALLY DRIVER Enjoy the thrills and spills of this exciting rally driving game by Eric H. Crisp Have you ever fancied having a go at being a rally driver? Well, with RALLY DRIVER you can turn your Electron into a driving simulator and try to steer your way round a course in the fastest time possible. It's just like the real thing. You can steer from left to right, accelerate, brake and - if you're not careful - crash! All the instructions are in the program. The rest is up to you. Drive carefully! Changes To extend the game, line 810 can be changed by increasing the value with which D% is compared, so making a longer rally. The curvature of the bends can be increased by increasing the random value assigned to C% at the end of line 750. To keep left and right bends equal, the first number should be twice the second number. The length of the bends can be increased by increasing the random value assigned to L% Variables C% Curve sharpness CP% Car's absolute position, horizontally CS% Car's steering speed CY% Car's forward speed D% Distance travelled F% Finished flag L% Length of curve P% Road section counter - proportional to distance in front of car PP% Penalty points T% Time delay V% A particular V%(P%) value W% A particular V%(P%) value   Arrays L%(P%) Screen x coordinate of section P% of the left verge R%(P%) Screen x coordinate of section P% of the right verge U%(P%) Screen x coordinate of section P% of the white line V%(P%) Screen y coordinate of section P% of the road X%(P%) Absolute x coordinate of section P% of the white line   Procedures PROCCalc Calculates the screen positions of the road sections on the screen PROCDraw Draws a road section PROCInitial Initialises variables and the screen for a new game PROCInstruct Dimensions arrays and displays the instructions PROCKeys Reads the keyboard and adjusts variables accordingly, makes the sound and displays the time and speed PROCResult Displays the result at the end PROCRoad Displays the road in the new position PROCTest Tests for position on the road and displays the relevant commentSHEEPRemember Bright Eyes, the program from Mike Rowe we featured in the March Electron User? We asked what next and wondered whether readers would send us programs with sheep leaping over gates. Well they have - or at least, Mike Rowe has risen to the occassion and sent us one. He doesn't tell us whether or not he's an insomniac! Now, who's going to send us a low flying pig? SPACE PODS Fight for survival on the distant planet Tau Theta. By Nicholas Timberlake You are tired but you must continue. For hours the battle has been raging and still the aliens press home their attacks. As commander of the Federation Fleet your mission is to protect the underground base on Tau Theta. The aliens are dropping robot space pods that burrow into the planet's surface. Were they to reach it and discover its scientific secrets the whole universe would fall to their onslaught. Despite fighting desperately, your battle fleet has been destroyed. The aliens' space pods have proved to be almost invincible. You have found refuge on one of two stationary satellites far above the surface of Tau Theta. Your last hope is the laser cannon based on the satellites, but their computer guidance has been destroyed. You will have to fire the cannons manually. But the space pods are relentless and it's getting harder to keep them at bay. How long will you be able to survive? SPACE PODS originally appeared in the July 1983 issue of The Micro User and has been specially adapted for the Electron. TIC TAC TOEElectron Tic Tac Toe is another version of the age old game of noughts and crosses. There's no pencil and paper though. You just pit your wits against the Electron. There are two skill levels. The easiest is level 1. But to beat the Electron on level 2 is almost - but not quite - impossible. Variables D% Equals 0 if game ended L% Equals TRUE if player lost N% Used as a loop counter P% Used as a loop counter W% Equals TRUE if player won X% X coordinate of O or X Y% Y coordinate of O or X rnd Equals TRUE if easy game selected win Equals TRUE if computer could beat you block Equals TRUE if computer could stop you X, Y, Z Pointers to array elements x, y, z Pointers to array elements Z$(n) Array holding all the pieces on the board   Procedures PROCins Prints up instructions PROCset Initialises start of each game PROCcomputer Decides computer's move PROCrnd Makes random move for computer PROCplayer Gets and checks player's move PROCx Puts an 'O' into the Z$(N) array, at the position pointed to by X, Y or Z PROCboard Draws the board PROCpieces Draws the Os or Xs PROCinit Sets up the computer for the start of play. Defines the envelopes, and picks the initial colours   Functions FNtry(1$) Returns TRUE if the string 1$ is found using FNt FNt Returns TRUE if three Os or three Xs are found in a row FNtest Returns TRUE if a free space is found in a line X, Y, Z