Imagine a snow-covered mountainside in the Austrian Alps. Television viewers are waiting to see world-class skiers tackle a long, difficult slalom, speeding downhill through a series of flag-marked ‘gates’.
You are going to control one of the skiers, using the Z key to move left and the X key to move right. Your skier must stay on course and will be disqualified if they miss a ‘gate’. The longer they survive, the narrower the gap between the flags becomes.
You can make the game more difficult at the start by reducing the value of J in line 150.
PROGRAM NOTES
Lines 100-140: Define the ‘skier’ and ‘flag’ characters, then set up text and background colours.
Lines 150-180: Store initial values of the variables.
Lines 190-200: Select a random position for the left-hand flag.
Lines 210-220: Scroll the screen and print the skier.
Line 230: Ensures that the right-hand flag is on screen.
Line 240: Checks that the skier is between the flags.
Lines 250-260: Print a new pair of flags.
Lines 270-330: Move the skier if the Z or X keys are pressed.
Lines 400-410: Print the score and stop the program.

