home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
451-475
/
apd460
/
andrew_cartwright
/
pools_program.amos
/
pools_program.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1978-02-06
|
6KB
|
227 lines
Rem ********************************
Rem * *
Rem * Written by A.Cartwright *
Rem * *
Rem * I AM NEW TO PROGRAMING *
Rem * *
Rem * And This Is My First *
Rem * *
Rem * Succesful Program *
Rem * *
Rem * Feel Free to exploit the *
Rem * *
Rem * The program. I Have put *
Rem * *
Rem * Rem's by the Important stuff *
Rem * *
Rem ********************************
'
Close Workbench : Rem these two commands save memory in case
Close Editor : Rem your machine only has half a meg
Screen Open 0,320,200,32,Lowres
Track Play 8 : Rem music supplied from easy amos
Track Loop On : Rem repeat music
Screen 0
Double Buffer
Curs Off : Cls 0 : Hide
Get Sprite Palette
Pen 5 : Paper 0 : Centre "POOLS PROGRAM"
Pen 11 : Locate ,2 : Centre "Written By Andrew Cartwright"
Pen 22 : Locate ,4 : Centre "With AMOS BASIC"
Pen 29 : Locate ,24 : Centre "Press Any Key"
Repeat
G$=Inkey$
Rem i have animated the man this way because i had
Rem some complication in grabbing the images from deluxe paint
Bob 1,100,50,1 : Wait 5 : Bob 1,108,49,2 : Wait 5
Bob 1,103,50,3 : Wait 5 : Bob 1,111,50,4 : Wait 5
Bob 1,115,50,5 : Wait 5 : Bob 1,106,50,6 : Wait 5
Bob 1,101,50,7 : Wait 5 : Bob 1,101,50,8 : Wait 5
Bob 1,100,48,9 : Wait 5 : Bob 1,103,47,10 : Wait 5
Bob 1,106,47,11 : Wait 5 : Bob 1,114,50,12 : Wait 5
Bob 1,117,49,13
Until Inkey$<>"" : Rem continue until a key is pressed
MAIN:
Channel 0 To Screen Display 0 : Rem assign animation channel to screen 0
A$="Move 20,0,0 ; Move 0,20,5 ; Move 20,0,0 ; Move 0,-20,5;"
A$=A$+"Move 20,0,5 ; Move 0,20,5 ; Move 20,0,5 ; Move 0,-20,5;"
A$=A$+"Move 20,0,5 ; Move 0,20,5 ; Move 20,0,5 ; Move 0,-20,5;"
A$=A$+"Move 20,0,5 ; Move 0,20,5 ; Move 20,0,5 ; Move 0,-20,5;"
A$=A$+"Move 20,0,5 ; Move 0,20,5 ; Move 20,0,5 ; Move 0,-20,5;"
A$=A$+"Move 20,0,5 ; Move 0,20,5 ; Move 20,0,5 ; Move 0,-20,5;"
A$=A$+"Move 20,0,5 ; Move 0,20,5 ; Move 20,0,5 ; Move 0,-20,5;"
A$=A$+"Move 20,0,5 ; Move 0,20,5 ;"
Amal 0,A$
Amal On : Rem Start Screen BOUNCE
Wait 150
Bob Off : Rem set up the next screen
Autoback 0
Cls 0
Ink 7 : Box 0,0 To 319,199 : Box 49,19 To 111,51 : Box 209,19 To 261,51
Pen 5 : Paper 0 : Locate ,1 : Centre "Please Choose Option"
Colour 2,$0 : Ink 2 : Bar 50,20 To 110,50
Colour 1,$0 : Ink 1 : Bar 210,20 To 260,50
Ink 5,0 : Text 52,38,"NUMBERS" : Text 220,38,"QUIT"
Channel 0 To Screen Display 0
B$="Move -20,0,0 ; Move 0,20,5 ; Move -20,0,0 ; Move 0,-20,5;"
B$=B$+"Move -20,0,3 ; Move 0,20,3 ; Move -20,0,3 ; Move 0,-20,5;"
B$=B$+"Move -20,0,3 ; Move 0,20,3 ; Move -20,0,3 ; Move 0,-20,5;"
B$=B$+"Move -20,0,3 ; Move 0,20,3 ; Move -20,0,3 ; Move 0,-20,5;"
B$=B$+"Move -20,0,3 ; Move 0,20,3 ; Move -20,0,3 ; Move 0,-20,5;"
B$=B$+"Move -20,0,3 ; Move 0,20,3 ; Move -20,0,3 ; Move 0,-20,5;"
B$=B$+"Move -20,0,3 ; Move 0,20,3 ; Move -20,0,3 ; Move 0,-20,5;"
B$=B$+"Move -20,0,3 ; Move 0,-10,3 ;"
Amal 0,B$
Amal On : Rem start screen bounce
Wait 100
Amal Off : Rem Stop Amal PROGRAM
Reserve Zone 2 : Rem reserve two zones
Set Zone 1,50,20 To 110,50
Set Zone 2,210,20 To 260,50
Z=Zone(X,Y) : Rem check coordinates
Show
Do
Rem left hand zone check and action
If Mouse Zone=1 Then Colour 2,$F65 Else Colour 2,$0
Rem right side zone checkand action
If Mouse Zone=2 Then Colour 1,$F65 Else Colour 1,$0
Rem left side zone checkand action
If Mouse Key=1 and Mouse Zone=2 Then Edit
Rem right side zone checkand action
If Mouse Key=1 and Mouse Zone=1 Then Goto BEGIN
Loop
'stop
BEGIN:
Dim A(58) : Rem set up array for pools numbers
Gosub SET_SCREEN
Track Stop : Rem stop music
WAIN:
If Mouse Key=1 Then Cls 0 : Sam Play 7 : Wait 50 : Stop : Rem End PROGRAM
A(1)=1 : Rem allocate value to a
A(2)=2
A(3)=3
A(4)=4
A(5)=5
A(6)=6
A(7)=7
A(8)=8
A(9)=9
A(10)=10
A(11)=11
A(12)=12
A(13)=13
A(14)=14
A(15)=15
A(16)=16
A(17)=17
A(18)=18
A(19)=19
A(20)=20
A(21)=21
A(22)=22
A(23)=23
A(24)=24
A(25)=25
A(26)=26
A(27)=27
A(28)=28
A(29)=29
A(30)=30
A(31)=31
A(32)=32
A(33)=33
A(34)=34
A(35)=35
A(36)=36
A(37)=37
A(38)=38
A(39)=39
A(40)=40
A(41)=41
A(42)=42
A(43)=43
A(44)=44
A(45)=45
A(46)=46
A(47)=47
A(48)=48
A(49)=49
A(50)=50
A(51)=51
A(52)=52
A(53)=53
A(54)=54
A(55)=55
A(56)=56
A(57)=57
A(58)=58
Gosub SHUFFLE
Gosub DEAL1
Gosub DEAL2
Gosub DEAL3
For B=1 To 11 : Rem amount of numbers to be displayed per window
Gosub MAINY
Gosub DEAL1 : Rem first window numbers
Gosub DEAL2 : Rem second window numbers
Gosub DEAL3 : Rem third window numbers
Next
'
Wait Key
Goto WAIN
'
SET_SCREEN:
Screen Open 0,320,200,16,Lowres
Curs Off : Flash Off : Cls 0 : Hide On
Paper 0 : Pen 5
Locate ,2 : Centre "This Program Is Designed So That"
Locate ,4 : Centre "The User Can Pick A Random Set Of"
Locate ,6 : Centre "Numbers. From 3 Windows. If You"
Locate ,8 : Centre "Want A New Set Of Numbers You "
Locate ,10 : Centre "Have To Press Any Key On The"
Locate ,12 : Centre "Keyboard. If You Want To Quit"
Locate ,14 : Centre "Then Hold Down The Left Mouse Button"
Locate ,16 : Centre "And Any Key On The Computer In"
Locate ,18 : Centre "That Same Order. I Wish You Luck"
Locate ,22 : Centre "PRESS ANY KEY TO START"
Wait Key
Cls 0
Ink 4
Box 100,0 To 210,15
Box 98,0 To 212,17
Draw 0,0 To 320,0
Ink 14,0
Text 103,10,"POOLS NUMBERS"
Paper 0 : Pen 5 : Wind Open 1,50,50,4,12
Wind Open 2,150,50,4,12
Wind Open 3,250,50,4,12
Return
'
SHUFFLE:
For B=1 To 400 : Rem this loop mixes up all the numers
S1=Rnd(57)+1
S2=Rnd(57)+1
S3=Rnd(57)+1
Swap A(S1),A(S2)
Next B
Return
'
DEAL1:
Inc TP : If TP>58 Then Gosub SHUFFLE : TP=1 : Rem this deals us our random numbers
NUMBER=A(TP)
Return
'
DEAL2:
Inc TP : If TP>58 Then Gosub SHUFFLE : TP=1 : Rem this also does random numbers
NUMBER1=A(TP)
Return
'
DEAL3:
Inc TP : If TP>58 Then Gosub SHUFFLE : TP=1 : Rem and so does this
NUMBER2=A(TP)
Return
'
MAINY:
Window 1 : Paper 0 : Pen 5 : Print NUMBER : Rem first window display
Window 2 : Pen 14 : Print NUMBER1 : Rem second window display
Window 3 : Pen 15 : Print NUMBER2 : Rem third window display
Return