Logo type; a lesson on X,Y coordinates.James Muller.

One of the more confusing features of Logo for many young users is learning to use X and Y coordinates. Indeed, it can be even more confusing for adults. Trying to get novice programmers to visualize the invisible axis that divides the screen into four quadrants can present real stumbling blocks to progress with Logo. But making a game out of it can make the concepts a bit more fun to work with, if not easier to grasp.

The coordinate game involves putting a target on the screen at a random location, and then guessing the X and Y coordinates of the target. The rules can make hitting the target very easy or require the players to guess the exact location. It's a bit more fun when a choice of different skill levels is designed right into the game.

Zap the Turtle is written in Atari Logo, though it can be easily translated to Apple Logo or other similar versions of the language. Atari Logo offers four turtles, each of which can change its shape. In this game, one turtle fires a missile at another turtle on the screen.

Turtle #1 si changed into a missile shape by using the EDSH command. This puts an 8 x 16 grid on the screen which can then be defined using the control keys and the spacebar.

Entering the word ZAP brings the introduction to the game on the screen. The P procedure then sets the level of difficulty: 5 is the easiest level and 0 is the hardest. READNUMBER takes your input and assigns it to the variable SKILL. We will explore this further in a moment, but first let's set up the screen.

Control of the game passes to the T procedure which then places the target turtle on the screen at a random location. The variables ANS1 and ANS2 become the X and Y coordinate postions. Then control passes on to the GAME procedure.

In this procedure, the player guesses the location of the target turtle by entering variables ANS3 and ANS4. These are then compared with the coordinates of the target. This is where the SKILL level comes into play. If the value of SKILL is 5, the player's guess can be off by plus or minus 5. If the value of SKILL is 0, the player must guess the exact coordinates.

When the player enters a guess that is off by more than the value of SKILL, control of the game is passed back to the beginning of the GAME procedure. IF within the limits set by the value of SKILL, control passes to the CHEERS procedure. Then the process starts all over again.

Those using Atari Logo can use the collision detection in that version of the language to test if their guess is on target or not. Those with Apple Logo or similar versions need only make some minor changes to play the game. Rather than use a turtle as the target, the turtle draws a small circle on the screen. The center of the circle will be exact coordinates of the target.

These are the changes required to run the game in Apple Logo: TO T :SKILL CLEARSCREEN CLEARTEXT MAKE "ANS1 (RANDOM 135) - (RANDOM 135) MAKE "ANS2 (RANDOM 110) - (RANDOM 70) PENUP SETPOS LIST :ANS1 :ANS2 CIRCLE GAME :SKILL END TO CIRCLE LEFT 90 FORWARD 5 RIGHT 90 PENDOWN REPEAT 36 (FORWARD 1 RIGHT 10) PENUP HOME PENDOWN END

In the game procedure, change the following lines: 1) Change the first line to read, PENREVERSE CLEARSCREEN; 2) Line 7 which starts, ASK 1, should read: SETPOS LIST :ANS3 :ANS4.

When young people start to use X and Y coordinates, it helps to draw the quadrants on the screen using erasable markers. Y ou can even add marks on the grid to help them estimate the distances involved. Off-Computer Activities

Another activity which helps children become familiar with coordinates is to us graph paper. Let the children draw the screen on the graph paper and then draw different small shapes on the paper just as the turtle does on the screen. If you have the time and space, let children play turtle. Mark the coordinates off on the floor and then have other children tell the turtle to move to different locations to pick up a book, or draw a square on a piece of paper. Making these activities competitive can add some enthusiasm to class or club sessions. Make it a scavenger hunt. Which team can move around the grid in the fewest moves to pick up a list of items?

The pencil, game, and other off-computer activities, have some subtle advantages. Children often have trouble understanding some of the abstract mathematical concepts in Turtle geometry. Using their bodies to feel these abstractions helps make those concepts come alive and makes them more understandable. Off-computer activities also help solve the problem of what to do with 25 students, one or two computers, and a 50-minute class period. Establishing "learning centers" where groups can work on the same fundamental concept in different ways helps children discover the variety of ways in which the same concepts can be used.

Next time we will look at some other ways in which Logo can come alive on and off the computer.