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.

cAnytimeyou type, the characters are stored in a special box in memory called a "linebuffer." When you press the RETURN key, the computer looks into the line buffer box.RULE: If it sees a line number at the start of the line, the computer moves the line intothe program in memory.RULE: If it doesn't see a line number, it executes the line like a program. The line mayhave several statements separated by colons ":". After execution, it forgets the line!THE COMPUTER'S JIFFY CLOCKThe computer has a clock which starts when the computer is turned on and runs all thetime. (Well, most of the time. It is turned off while the computer loads from tape or savesto tape.)The clock reads in "jiffies" of 1/60 second each. The reading is kept in a special variablebox with the name TI.Run10 PRINT TI20 GOTO 10The clock can tell you how long something takes to do by subtracting before and afterreadings of the TI variable. Divide the jiffy clock reading by 60 to get the time in seconds.Run10T=TI20 FOR 1=1 TO <strong>1000</strong>:NEXT I30 S=TI-T40 PRINT "THE LOOPTOOK";S;IIJIFFIES"50 PRINT "THAT IS";S/60;"SECONDS"Assignment 20:1. Read the naming rules numbered 1 through 8. For each rule make up two names, onewhich is correct, and one which disobeys the rule. (Rule number 6 has no wrong name.)Try each name in a line like 10 NAME=1 or 10 NAME$="A" to see if it is alegal name.2. Is SUPERCALIFRAGELISTICEXPIALIDOCIOUS a legal name? Why or why not? Ifnot, fix it.3. How can you tell if the computer is in the edit mode?4. What does the computer do in the RUN mode?5. What mode does the computer enter when the program has finished running?6. Write a "reaction time tester." Flash a question mark on the screen at a random time.The user presses the RETURN key as soon as she sees the question mark. Measurethe time delay by counting how much the "jiffy" clock has changed. Print out the timefor the user to see.119

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

Saved successfully!

Ooh no, something went wrong!