11.07.2015 Views

Here - 1000 BiT

Here - 1000 BiT

Here - 1000 BiT

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

These two ways throw away all the variable boxes made the last time, thenexecute the program.RUNRUN XXstarts at the first line of the programstarts at line XXCONT can restart only a program that was stopped with a break from a STOP commandor by pressing the STOP key.But RUN, RUN XX and GOTO XX can also start a new program.OODEBUGGINGLittle errors in your program are called bugs.If your program doesn't run right, do these four things:1. If the computer printed an ERROR MESSAGE, it tells what line it stopped on.Careful, the mistake may really be in another line!2. If the computer just keeps running but doesn't do the right thing, stop it and put insome PRINT lines which will tell what is happening.u3. Or you can put STOP commands into the program.4. If the program runs so fast that you can't tell what is happening, put in some delayloops to slow it down.After you have fixed the program, take the PRINT lines, the STOPs and the delayloops out of the program.O(jAssignment 33:1. Go back to the SNAKE program and fix up some of the bugs. For example, theprogram "crashes" when the snake hits a wall. Add "food" for the snake. Add scorekeeping. Let the game end if the snake touches a wall.o2. Write a "shape shifter" program. A shape shifter is a demon which starts in one shapeand shifts around its parts to make other shapes.194

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!