home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
476-500
/
apd483
/
master_source.amos
/
master_source.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1993-03-07
|
4KB
|
129 lines
' Mastermind Ver 1.0
'
' � 1993 Neil Wright
'
' Greetings to Jon
'
' Thanks to Gordon and Chrissy
' for debugging it.
'
' Look out for version 2.
'
' Buy FontX, the excellent text font editor
'
' available now from AMOS PD.
'
' Features include:
'
' Intuitive user interface,
' Invert and flip characters on both axis,
' and even more advanced features!!!
'
' End of commercial break, and on with the show:
'
Sam Bank 10
Screen Open 0,320,256,32,Lowres
Curs Off : Flash Off : Hide : Cls 0
'
Dim ACTUAL(4),GUESS(4)
Global GOS
MAIN:
Auto View Off
Unpack 6 To 0
Reserve Zone 6
Set Zone 1,24,58 To 37,71 : Rem purple
Set Zone 2,24,76 To 37,89 : Rem pink
Set Zone 3,24,93 To 37,106 : Rem red
Set Zone 4,24,110 To 37,123 : Rem green
Set Zone 5,24,127 To 37,140 : Rem blue
Set Zone 6,24,145 To 37,158 : Rem yellow
'
Paper 0 : Pen 13
For T=1 To 4
ACTUAL(T)=Rnd(5)+1
Next T
Y=0
For U=1 To 4
Paste Bob 250,76+Y,ACTUAL(U)
Y=Y+17
Next U
Bob 10,245,63,16
Double Buffer
Wait 5
View
Auto View On
A=1 : Y=0 : X=0 : PINTER=7
COUNTER=0
Do
Bob 40,X Screen(X Mouse),Y Screen(Y Mouse),PINTER
M=Mouse Zone
If M>0 and Mouse Click<>0 and COUNTER<4
Sam Play 1,2,3000
GUESS(COUNTER+1)=M
PINTER=M+6
Paste Bob 67+X,76+Y,M
Inc A : Inc COUNTER
Y=Y+17
End If
If COUNTER=4
Gosub CHECK
If GUESS(1)=ACTUAL(1) and GUESS(2)=ACTUAL(2) and GUESS(3)=ACTUAL(3) and GUESS(4)=ACTUAL(4)
Bob 2,130,90,17
Bob Off 10
Sam Play 1,13,4000
Repeat : Until Mouse Key<>0
Fade 4
Wait 50
Gosub MAIN
End If
If X>=130
Bob 2,130,90,18
Bob Off 10
Sam Play 1,12,3000
Repeat : Until Mouse Key<>0
Fade 4
Wait 50
Gosub MAIN
End If
X=X+15 : Y=0
COUNTER=0
End If
Loop
CHECK:
Rem *** The new, bug free (hopefully) CHECK routine ***
POS=4
CHECKCOUNTER1=1
CHECKCOUNTER2=1
CHECKCOUNTER3=1
For T=1 To 4
If GUESS(T)=ACTUAL(T)
If CHECKCOUNTER1=1 : Paste Bob 67+X-1,62,13 : End If : Rem topleft
If CHECKCOUNTER1=2 : Paste Bob 67+X+6,62,13 : End If : Rem top right
If CHECKCOUNTER1=3 : Paste Bob 67+X-1,148,13 : End If : Rem bottom left
If CHECKCOUNTER1=4 : Paste Bob 67+X+6,148,13 : End If : Rem bottom right
End If
If GUESS(T)=ACTUAL(POS) and GUESS(POS)<>ACTUAL(POS) and GUESS(T)<>ACTUAL(T)
If CHECKCOUNTER2=1 : Paste Bob 67+X-1,62,14 : End If : Rem topleft
If CHECKCOUNTER2=2 : Paste Bob 67+X+6,62,14 : End If : Rem top right
If CHECKCOUNTER2=3 : Paste Bob 67+X-1,148,14 : End If : Rem bottom left
If CHECKCOUNTER2=4 : Paste Bob 67+X+6,148,14 : End If : Rem bottom right
End If
If GUESS(T)=ACTUAL(POS) and GUESS(POS)=ACTUAL(POS) and GUESS(T)<>ACTUAL(T)
If CHECKCOUNTER2=1 : Paste Bob 67+X-1,62,15 : End If : Rem topleft
If CHECKCOUNTER2=2 : Paste Bob 67+X+6,62,15 : End If : Rem top right
If CHECKCOUNTER2=3 : Paste Bob 67+X-1,148,15 : End If : Rem bottom left
If CHECKCOUNTER2=4 : Paste Bob 67+X+6,148,15 : End If
End If
If GUESS(T)<>ACTUAL(T) and GUESS(T)<>ACTUAL(POS)
If CHECKCOUNTER3=1 : Paste Bob 67+X-1,62,15 : End If : Rem topleft
If CHECKCOUNTER3=2 : Paste Bob 67+X+6,62,15 : End If : Rem top right
If CHECKCOUNTER3=3 : Paste Bob 67+X-1,148,15 : End If : Rem bottom left
If CHECKCOUNTER3=4 : Paste Bob 67+X+6,148,15 : End If : Rem bottom right
End If
Dec POS
Inc CHECKCOUNTER1 : Inc CHECKCOUNTER2 : Inc CHECKCOUNTER3
Next T
Return
'
Rem That's all folks!!!