• Aucun résultat trouvé

Count The Hearts

Dans le document Commodore And (Page 88-92)

CHRISTOPHER J. FLYNN

As yet there are very few computer programs suitable for young children. However, the computer can be a fascinating learning aid for children. Graphics and sound will hold the attention of the very young while teaching. "Count the Hearts" is a colorful program for preschoolers.

"Count the Hearts" is a program which will help you develop your child's counting skills. VIC will display a certain number of hearts on your television screen. Ask your child to count them. If your child can correctly count the hearts, he or she will be rewarded by a duet of chirping birdies. To challenge older children, you can limit the time VIC allows for a response.

Once it is set up, no reading is required to play "Count the Hearts." However, preschoolers will probably need you to help them with the keyboard.

Setting Up

When you first start "Count the Hearts," it will ask you for a range of numbers and a time limit.

You can tailor the game to your child's counting skills by trying different number ranges. For example, you may want to start with numbers between one and five. Gradually, a child will work up to counting up to ten. If you notice difficulties with some numbers, you might want to work within that range (say from six to nine).

Here is how VIC will ask you to set the number range:

1. VIC will display:

ENTER NUMBER RANGE LOWNUMBER(l)?

2. You should type in the low number in the range (don't forget to hit RETURN). If you just hit RETURN, VIC will use one as the low number.

3. Next VIC will ask:

HIGH NUMBER (9)?

4. Now type in the high number. Again, if you just hit RETURN,

VIC will use nine as the high number.

VIC will make sure that your low number is really lower than your high number. It will also make sure that neither number is greater than 484. Why 484? Well, that's how many spaces are left on the screen for displaying the hearts.

The time limit gives you a way to speed up "Count the Hearts."

If you don't take a guess at how many hearts there are within the time limit, then VIC will let you know that time's up. VIC will then just start another game.

VIC will ask you for the time limit:

5. VIC will display:

TIME LIMIT PER SET SECONDS (120)?

6. Type in the number of seconds you want to use for the time limit. If you just type RETURN, VIC will set the time limit to 120 seconds, or two minutes.

By the way, if, in any of the above steps, VIC didn't understand your response, it will either ask the question again or ask you to repeat

your response.

Counting Hearts

The television screen will go blank forjust an instant. In that brief instant VIC is deciding how many hearts it will ask you to count.

Then, one by one, VIC displays the hearts at random locations on the television screen. As it shows each new heart, VIC says in a deep voice, "BEEP!" Notice how VIC paints the hearts in different colors.

Now VIC will ask:

HOW MANY HEARTS?

Ask your child to count them. Type in the number (don't forget RETURN!) and see what happens. What happens if your child gives the right answer? How about a wrong answer? What is your child's reaction?

VIC will start a new game when the right answer is typed in or when time runs out and nothing has been heard from the keyboard.

VIC is very patient with small folks learning to count. When a wrong answer is given, VICjust resets its timer and gives them another try.

Scoring

When finished playing "Count the Hearts, "just hit the Fl key in reply to the "HOW MANY HEARTS?" question. VIC will promptly

CHAPTER TWO

clear the screen and tell you:

- how many games were played - how many correct answers there were - how many wrong answers there were - how many times the player ran out of time

By keeping track of the number range (VIC shows you the range you used) and the scores, you can note your child's progress. For example, do you notice a little slowness in your child's learning to count past ten? We did. That seems to be the upper limit for our three year old for a while.

Hints

You probably don't need to be reminded that the attention span of preschoolers is not long. Try to move on to another activity before your child gets bored and begins to act silly. You want your child to

remember counting as something that is fun to do.

One way for you to help beginners is for you to point to the hearts very slowly, one by one. Let your child count them as you point to them. Gradually your child will take over the_pointing. And, before you know it, your child will be typing in the numbers on the keyboard! Experiment. Try out different arrangements. What works best for you?

The program will run on a standard VIC without memory expansion. If you need to, you should be able to modify "Count the Hearts" without too much trouble.

Now you Ye ready to play "Count the Hearts"! But remember, to stop the game and see your score, all you need to do is press the Fl key. Have fun.

100 REM VIC-20

110 REM COUNT THE HEARTS 120 REM VI.0 7/81

130 REM COPYRIGHT 1981 HOMESPUN SOFTWARE 200 REM

210 REM HEARTS.BEGIN 220 GOSUB 30000 230 REM PLAY GAMES 240 GOSUB 1000 250 IF Q=0 THEN 240 260 REM HEARTS.END 270 GOSUB 31000 280 END

82

1000 REM PLAY GAMES 1010 PRINT CHR$(147) 1020 REM DISPLAY HEARTS

1030 N=LO+INT((HI-LO+1)*RND(1)) 1040 FOR 1=1 TO N

1050 P=INT(484*RND(1))

1060 CL=INT(8*RND(1)) :IF CL=1 THEN 1060 1070 IF PEEK(VA+P)=83 THEN 1050

1080 POKE VA+P,83 1090 POKE CA+P,CL 1100 POKE VL,15 1110 POKE S2,200

1120 FOR Z=l TO 400:NEXT 1130 POKE S2,0:POKE VL,0 1140 NEXT I

1150 G=G+1:REM GAMES 1160 PRINT CHR$(19);

1170 FOR I=1TO21:PRINT" "; :NEXT

1180 PRINTCHR$(19);"HOW MANY HEARTS ? ";

1190 REM GET RESPONSE 1200 GOSUB 3000

1210 IF R$ = "QUIT11 THEN Q=1:RETURN

1220 IF R$ = "TIMEtl THEN GOSUB 9000:RETURN 1230 REM O.K.?

1240 R=VAL(R$)

1250 IF RON THEN GOSUB 5000:GOTO 1160 1260 IF R=N THEN GOSUB 7000

1270 RETURN

3000 REM TIMED RESPONSE 3010 T1=TI+SC*60

3020 R$ = IMI

3030 REM TRY A KEY 3040 GET A$

3050 IF TI>T1 THEN R$=nTIMElf: RETURN 3060 IF A$ = Iln THEN 3040

3070 IF ASC(A$)=133 THEN R$ = HQUITil: RETURN 3080 IF ASC(A$)=13 THEN RETURN

3090 IF ASC(A$)=20 AND LEN(R$)>0 THEN GOSUB 330 0:R$=LEFT$(R$,(LEN(R$)-1)):GOTO3040

3095 IF ASC(A$)=20 THEN 3040 3100 PRINT A$;

3110 IF A$<"0fl OR A$>"9fl THEN GOSUB 3300:GOTO 3 040

3120 R$=R$+A$

3130 GOTO 3040 3300 REM BACKSPACE

CHAPTER TWO

^

3310 PRINT CHR$(157) ; 3320 PRINT w ";

3330 PRINT CHR$(157);

3 340 RETURN 5 000 REM WRONG 5010 WR=WR+1

5030 REM UFO-VARIATION 5040 POKE VLf15

5050 FOR L=l TO 15 5060 POKE SB,42

5070 FOR M=200 TO 220+L*2 5080 POKE S3,M

5090 NEXT M 5100 POKE SBf25

5110 FOR Z=1TO 25:NEXT Z 5120 NEXT L

5130 POKE VLf0:POKE S3r0 5140 POKE SBf27

5150 RETURN 7000 REM RIGHT 7010 RI=RI+1

7020 REM BIRDS VARIATION

7025 PRINT CHR$(19);:FOR Z=l TO 21:PRINT " ";:N EXT Z

7030 POKE VL,15 7040 FOR L=l TO 20

7050 PRINT CHR$(19);SPC(5);CHR$(106);CHR$(113) ; CHR$(107) ;

7055 PRINT SPC(5);CHR$(117);CHR$(113);CHR$(105) 7060 FOR M=254 TO 240+RND(l)*10 STEP -1

7070 POKE S3,M 7080 NEXT M 7090 POKE S3,0

7100 FOR M=l TO 100:NEXT M

7110 PRINT CHR$(19);SPC(5);CHR$(117);CHR$(113);

CHR$(105) ;

Dans le document Commodore And (Page 88-92)