12.07.2015 Views

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

160 PRINT S;n SECONDS HAVE ELAPSEDn170 PRINT180 PRINT190 GOTO 1031 Wipeout!Warning: handle with care!Careless operation of this program can cause you a lotof extra work.Key in the program. Run it. When it asks for thepassword, be sure to give it what it wants or it will eraseitself. That's right, the entire contents of program memorydown the tubes!Here's how It works:The password, In this case Tracey , is asked by line 20.You give it a password. In line 30, your answer is comparedto the true password. If correct, action goes to line50. If incorrect, the program goes to line 40.The NEW statement in line 40 erases everything fromprogram memory.You can change the password in line 30 to any letters,numbers or keyboard symbols of your choice. Watch outwhen testing. A wrong password can cause a lot of retyping.Program Listing10 PRINT "WHAT IS THE SECRET WORD ?n20 INPUT W$30 IF W$="TRACEYn THEN GOTO 5040 NEW50 PRINT "CORRECTn60 PRINT "THE SECRET WORD IS ";W$45

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

Saved successfully!

Ooh no, something went wrong!