11.07.2015 Views

Here - 1000 BiT

Here - 1000 BiT

Here - 1000 BiT

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

INSTRUCTOR NOTES 16 MOVING PICTURESThe cursor arrow keys are used in PRINT commands to move the cursor to any part of ^jthe screen. Take care that each PRINT command ends with a semicolon or else thecursor will drop down to the beginning of the next line and not be where you think it is! ^JAlso, if you try to move the cursor lower than the bottom of the screen, the whole picture ^will scroll. A scroll will also occur if you print in the 40th column on line 25. This won'tscroll:10 FOR 1=1 TO 24:PRINT I:NEXT I20 PRINT" 123456789012345678901234567890123456789"; ^J30 GOTO 30But add a "0" to the end of the string (making 40 characters) and the screen will scroll.To make moving pictures, you must erase the old picture before you draw the new one. ^jThis complication, on top of having to keep an accurate mental picture of where theinvisible PRINT cursor is at all times, may overwhelm your student. ^JThe remedy is slow, careful and complete analysis of the print statements, keeping ^accurate track of the cursor position. Drawing a grid to represent the screen, then lightly ,sketching the characters one by one (and erasing them as spaces are printed over them)is the best way to control the situation. ^jIf your program runs in an unexpected way, it helps to put in a lot of delay loops so you ^Jcan accurately see the order in which PRINTING is done.QUESTIONS:^1. What is the difference between "dr" and "hm" in a PRINT command?2. Show two lines in a program which together will put a letter "A" on the screen at thepoint three lines down and seven spaces across. ^3. In this line, the word "HAPPY" is printed. Where is the PRINT cursor after the wordis printed? ^j10 PRINT'hm dn HAPPY"; WCan you see the PRINT cursor on the screen?^4. Now write a line 20 which will erase the letters "APP" from the word printed inquestion 3.^94

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

Saved successfully!

Ooh no, something went wrong!