home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
476-500
/
apd483
/
hilow.amos
/
hilow.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1992-02-08
|
6KB
|
242 lines
'************************************************************
'* Programmed By Ray (Zimmer) Watson of Gemini Software. *
'* With the help of DPaint IV and the stunning new Amos Pro.*
'* Don't Panic it will also work on Amos 1.3 . *
'* *
'* I hope this is of some use to new Amos programmers . *
'* Please use and abuse this listing as you feel fit. *
'* *
'*P.S. If anyone writing a demo would like to greet Gemini *
'* we will not be offended. *
'* *
'* HAPPY COMPUTING *
'* Ray *
'************************************************************
'
'*********** Set Up The Screens ***********
Screen Open 1,640,70,8,Hires : Cls 0
Screen Display 1,140,120,,
Screen Hide 1
Screen Open 0,320,256,16,Lowres
Cls 0 :
'********** Variables ***********
Dim CARDS(52)
Dim MESAGE$(14)
SP$=Space$(29)
CASH=5
BANK=500
For A=1 To 14
Read MESAGE$(A)
Next A
Unpack 2 To 0
Get Palette 0
'*********** Set Things Up Never to Return **********
Screen 0
Paper 0 : Pen 3
Gosub BANK1
Limit Mouse 128,42 To 448,298
Reserve Zone(6)
Set Zone 1,112,220 To 203,235
Set Zone 2,140,171 To 180,187
Set Zone 3,101,152 To 141,168
Set Zone 4,179,152 To 219,168
Set Zone 5,306,101 To 316,116
Set Zone 6,306,117 To 316,130
MZ=Mouse Zone
MC=Mouse Click
'*********** Start The Game **********
MAINLOOP:
Gosub BANK1
If BANK<=0 Then WL=13 : Gosub WINLOOSE
If BANK=>999 Then WL=14 : Gosub WINLOOSE
Bob Off
Gosub MESAGE1 : Print MESAGE$(6)
Hide
Wait 50
Show
CARD=0 : F=0
Gosub MESAGE1 : Print MESAGE$(3)
For A=1 To 52
CARDS(A)=0
Next A
CP=72
Gosub CARDCHOICE
Repeat
MZ=Mouse Zone
MC=Mouse Click
If MZ=1 and MC=1 Then Gosub INFO
If MZ=2 and MC=1 Then Gosub FIN
If MZ=3 and MC=1 Then Gosub HIGH
If MZ=4 and MC=1 Then Gosub LOW
If MZ=5 and MC=1 and F=0 Then Gosub MONEYUP
If MZ=6 and MC=1 and F=0 Then Gosub MONEYDO
Until MZ=2 and MC=2
FIN1:
Gosub MESAGE1 : Print MESAGE$(2) : Wait 50
Edit
'*********** Hi or Low Take your Pick ***********
HIGH:
Gosub MESAGE1
Bob 59,306,101,59
F=1
TEMP=C
Gosub CARDCHOICE
If C>TEMP and CARD=5
Gosub MESAGE1 : Print MESAGE$(10) : Wait 50
BANK=BANK+CASH
Goto MAINLOOP
End If
If C<=TEMP
Gosub MESAGE1 : Print MESAGE$(9) : Wait 50
BANK=BANK-CASH
Goto MAINLOOP
End If
Return
LOW:
Gosub MESAGE1
Bob 59,306,101,59
F=1
TEMP=C
Gosub CARDCHOICE
If C<TEMP and CARD=5
Gosub MESAGE1 : Print MESAGE$(10) : Wait 50
BANK=BANK+CASH
Goto MAINLOOP
End If
If C=>TEMP
Gosub MESAGE1 : Print MESAGE$(9) : Wait 50
BANK=BANK-CASH
Goto MAINLOOP
End If
Return
'*********** Pick a Card Any Card? *********
CARDCHOICE:
C=Rnd(51)+1
If CARDS(C)=1 Then Goto CARDCHOICE : Rem ***** If Card Already Chosen? Chose again *****'
CARDS(C)=1
Bob C,CP,101,C
If C>39 Then C=C-39
If C>26 Then C=C-26
If C>13 Then C=C-13
CP=CP+37
Inc CARD
Return
'********** Check for Quit **********
FIN:
Gosub MESAGE1
Locate 5,25 : Print MESAGE$(8)
Bob 56,101,152,56
Bob 55,179,152,55
Do
MZ=Mouse Zone
MK=Mouse Key
If MZ=3 and MK=1 Then Goto FIN1
If MZ=4 and MK=1 Then Goto FIN2
Loop
FIN2:
Paste Bob 101,152,58
Paste Bob 179,152,57
Gosub MESAGE1
Goto MAINLOOP
Return
'********** Win Lose Routine *********
WINLOOSE:
Gosub MESAGE1 : Print MESAGE$(WL)
Paste Bob 101,152,56
Paste Bob 179,152,55
Do
MZ=Mouse Zone
MK=Mouse Key
If MZ=3 and MK=1 Then Goto FIN11
If MZ=4 and MK=1 Then Goto FIN1
Loop
FIN11:
BANK=500
Gosub BANK1
Paste Bob 101,152,58
Paste Bob 179,152,57
Gosub MESAGE1
Return
'********** Betting Routine **********
MONEYUP:
If COUNT>0 Then Goto FIN5
If CASH=>50
Gosub MESAGE1
Print MESAGE$(4)
CASH=50
Goto FIN5
End If
CASH=CASH+5
Gosub PCASH
Gosub MESAGE1
FIN5:
BET=CASH
Return
MONEYDO:
If COUNT>0 Then Goto FIN6
If CASH=<10
Gosub MESAGE1
Print MESAGE$(5)
CASH=5
Locate 35,15 : Print "05"
Goto FIN6
End If
CASH=CASH-5
Gosub PCASH
Gosub MESAGE1
FIN6:
BET=CASH
Return
'********** Infomation Screen **********
INFO:
Hide
Gosub MESAGE1
Print MESAGE$(7)
Bob 54,112,220,54
Screen To Front 1
Screen Show 1
Screen 1
Curs Off
Locate 0,0
Paper 0
Print Pen$(2)+"This program was written using"+Pen$(5)+" AMOS PRO"+Pen$(2)+"and "+Pen$(5)+"DELUX PAINT IV "+Pen$(2)+"The Idea of the game"
Print "is to Place your bet on the first card. Then to try to guess if the next four "
Print "cards will be Higher or Lower.If you complete a run of all five cards you Win."
Print "Just to make things a little harder get a pair and you lose."
Print : Centre Pen$(6)+"Program By R.Watson"+Pen$(2)+" (Zimmer) "+Pen$(6)+"Of GEMINI "
Print : Print : Centre Pen$(4)+"Left Mouse Button Please"
Repeat
Until Mouse Click=1
Show
Screen To Back 1
Screen 0
Paste Bob 112,220,53
Gosub MESAGE1
Return
BANK1:
Locate 2,15 : Print " "
Locate 2,15 : Print BANK
Locate 35,15 : Print "05"
CASH=5
Return
'********** Message Strings **********
Data SP$,"....Programmed By R.Watson....","Place Your Bets ","Sorry The Top Limit Is 50"
Data "Sorry The Lowest Limit Is 5","Shuffling Cards Please wait","Left Mouse Button To Return"
Data "QUIT? Are You Sure","Sorry You Lost That Round","CONGRATULATIONS","Nothing For a Pair Not in this Game"
Data "Your Stating Card","Your out of Money Replay?","You've broke the Bank Replay?"
'********** Clears Message Window **********
MESAGE1:
Locate 5,25 : Print MESAGE$(1)
Locate 5,25
Return
'********** Print Bet **********
PCASH:
Locate 34,15 : Print " "
Locate 34,15 : Print CASH
Return