Here - 1000 BiT

Here - 1000 BiT Here - 1000 BiT

11.07.2015 Views

HOW TO NUMBER THE LINES IN A PROGRAMClear the screen.Enter NEW and then this program:1 REM HELLO2 PRINT "HI"3 PRINT "FRIEND"This program has three lines. Each line starts with a command. You have alreadylearned the PRINT command. We will tell you about the REM command in a minute.Usually you will skip numbers when writing the program.Like this:10 REM HELLO15 PRINT "HI"20 PRINT "FRIEND"It is the same program but has different numbers. The numbers are in order, but somenumbers are skipped. You skip numbers so that you can put new lines in between the oldlines later if the program needs fixing.Run the program you have entered. The computer does the commands in the lines. Itstarts with the lowest line number and goes down the list in order.THE REM COMMANDThe REM command is for writing little notes to yourself. The computer ignores the notes.Use REM for putting the name of your program in the top line of the program.Assignment 1:1. Use the HOME key to send the cursor home.Now use the same key (SHIFT CLR) to erase the screen.2. Use the command NEW. Explain what it does.3. Write a program which uses REM once and PRINT twice. Then use the commandRUN to make the program obey the commands.18

nINSTRUCTOR NOTES 2COLOR AND THE KEYBOARDThe C-64 has powerful color and graphics characters available from the keyboard. They^ provide plenty of "bells and whistles" to the student for increasing program richness.Each key has up to three functions, chosen by just pressing the key, or by pressing it whiler*\ holding down the SHIFT, CTRL or the COMMODORE FLAG key. For colors, the CTRLkey is held down while a color key (one of the number keys) is pressed.The CLR HOME key homes the cursor when pressed. (Home is the upper left corner ofthe screen.) Pressed with SHIFT, the CLR key erases the screen.All these keys can be used in PRINT commands in a program. This gives the C-64 someO very powerful options, and several lessons in the book are devoted to exploring them.A white background is used in this lesson. Some colors do not show up well on white. Infact, for each color screen there will be some colors which give blurry characters.If you choose white for the screen color and then white for the letter color, you will seenothing when you type! Try POKE 53281,15 for a grey screen which will show letters ofany color obtained from the color keys.Pressing the CTRL and RVS ON keys gives reversed characters. The reverse of a "space" is acolored block. A useful way to make color bars for adjusting the color TV is to do CTRLand RVS ON, then hold down the space bar to make a colored bar. Repeat for each of thecolors you get from CTRL and a color key. Then adjust your TV for best color. Yellowand perhaps purple are the most sensitive to proper adjustment.QUESTIONS:1. How do you do each of these things:^r*\nMake the computer type with red letters?Erase the screen?Empty the memory?Print your name?2. How do you change the screen background color to white?^ 3. What special key to you press to "enter" a line?r*\ 4. What is a command? Give some examples.^ 5. What does the computer mean when it prints "SYNTAX ERROR"?6. How could you print "FIRE" with each letter in a different color?19

HOW TO NUMBER THE LINES IN A PROGRAMClear the screen.Enter NEW and then this program:1 REM HELLO2 PRINT "HI"3 PRINT "FRIEND"This program has three lines. Each line starts with a command. You have alreadylearned the PRINT command. We will tell you about the REM command in a minute.Usually you will skip numbers when writing the program.Like this:10 REM HELLO15 PRINT "HI"20 PRINT "FRIEND"It is the same program but has different numbers. The numbers are in order, but somenumbers are skipped. You skip numbers so that you can put new lines in between the oldlines later if the program needs fixing.Run the program you have entered. The computer does the commands in the lines. Itstarts with the lowest line number and goes down the list in order.THE REM COMMANDThe REM command is for writing little notes to yourself. The computer ignores the notes.Use REM for putting the name of your program in the top line of the program.Assignment 1:1. Use the HOME key to send the cursor home.Now use the same key (SHIFT CLR) to erase the screen.2. Use the command NEW. Explain what it does.3. Write a program which uses REM once and PRINT twice. Then use the commandRUN to make the program obey the commands.18

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

Saved successfully!

Ooh no, something went wrong!