home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hand Held Organizer Toolkit
/
walnutcreekcdrom-handheldorganizertoolkit-march1998.iso
/
PalmPilot
/
games
/
simon.txt
< prev
next >
Wrap
Text File
|
1997-12-30
|
1KB
|
87 lines
# SIMON V1.0
# Freeware
# By Alex Garza (02/13/97)
# e-mail: agarza@mail.giga.com
# Please wait while program is
# being loded...
new
10 dim a(50)
20 gosub 400
30 s=30
40 ? "SIMON SAYS: Press OK to start."
# main loop
50 for c=1 to 50
60 a(c)=rnd(9)
70 if c>4 then s=45
80 if c>9 then s=100
# pilot's turn
90 for b=1 to c
100 j=a(b)
110 gosub 500
120 gosub 400
130 next b
# human's turn
140 for b=1 to c
150 gosub 700
160 gosub 500
170 gosub 400
180 if a(b) <> j then 900
190 next b
200 o=fn 22
210 next c
220 ? "Congratulations! You won."
230 goto 910
# clear screen
400 o=fn(42)
# draw grid
410 for i=20 to 140 step 40
420 grline i,20,i,140
430 grline 20,i,140,i
440 next i
450 return
# draw square
500 x=(j mod 3)*40+20
510 y=j/3*40+20
520 f=400*(1.05946^j)
530for i=2 to 38 step 4
540 grline x+i,y+40-i,x+i,y+i
550 grline x+40-i,y+i,x+i,y+i
560 next i
570 sound f,s,32,"t"
580 return
#read pen
700 t1=fn 34
710 t2=fn 34
720 if (t1=t2) then goto 710
730 x=(peek(0x1c4,2)+20)/40
740 y=(peek(0x1c6,2)+20)/40
750 j=x+3*(y-1)-1
# validate pen entry
760 if x<1 or x>3 then 790
770 if y<1 or y>3 then 790
780 return
790 sound 440,18,64,"S"
800 goto 700
# end
900 ? "Sorry, Wrong move! Correct:",c-1
910 input "Play Again? (y/n)",n$
920 if not n$="n" then 20
930 end
run