The following article was printed in July 1992 of the magazine „8000 PLUS"
A game programmed in BASIC

EVOLUTION by Keith Boothroyd

It's been a while since we've had a game in the Listings pages, so this month we thought we'd redress the balance. EVOLUTION is a card game with a difference - in some ways it's quite like an ordinary game of patience, while in others it couldn't be further away. And, as a further bonus, it's a little bit educational too!
The basic idea behind the game is that the computer picks a random card with seven letters on it, and then deals you a selection of 40 cards. All you have to do is to get one of your cards to match the PCW's (shown in the top right of the screen) - unless you're very lucky, this won't happen by accident.
Play consists of you picking whichever of your cards you think most closely resembles the computer's choice, and then typing this card's number in as the 'seed' for the next generation. Your next 'hand' of 40 cards are based around this seed, with a few random changes - you should find that at least one of the 40 should be getting more like the goal, so you should choose that as the seed for the next generation, and so the game proceeds.
The object of the game is to match the computer's card in as few generations as possible - to do this you need to study each hand quite carefully, and be sure to select cards which are as close as possible the PCW's original choice. It's often quite possible to 'throw away' letters which you want, so take care to avoid that as well!
EVOLUTION's educational aspect derives from the fact that the the gameplay is very much like the process of natural selection. By choosing the card you think is most like the computer's, you are in fact ensuring the 'survival of the fittest' - fitness here being measured by similarity to the computer's choice. In the real world, there isn't a definite goal to evolve towards, but EVOLUTION still demonstrates how selecting the best of random changes can lead to some remarkably interesting results.
The version shown here is probably in its simplest form - after a a bit of practice, you should usually be able to match the computer's card within around 10 generations. If you find the game too tricky, you should change the 6 in line 70 to a smaller number, or if you want more of a challenge, make it bigger - this will also introduce extra characters into the card symbols.
From a presentation point of view, we've decided to use letters as the varying symbols; the author's longer version has user-defined graphics so that the characters on each card actually look like different generations of animals. There's no reason why the same principle shouldn't be applied to word or number games or even a two-player version, where you compete against another person. Or, to be really clever, why not teach the PCW how to play?
When it comes to card games with a slightly unusual twist to them, EVOLUTION just has to be the natural selection!

You'll probably recognise much of the setting up in lines 10-40. The interesting part comes in lines 50-80, which is where the new cards (stored in the string array 'j$') are dealt. Line 60 checks if a value has already been 'inherited' from the previous generation
This produces EVOLUTION's attractive screen display. Lines 90-110 do the computer's card, while 120-180 handle the grid of 40 cards for the player to choose from. 'et%' (in line 120) shows whether the computer has chosen a card yet
Line 210 checks if a match has been found, and line 220 gets the player's choice for the next 'seed'. Lines 230-260 start off the next generation by basing it on the seed card chosen. And line 270 finishes off the game when everything matches up
[BASIC-Listing]

Scanned by Werner Cirsovius
December 2004
© 8000 PLUS