! Project 2
! This is a game that allows the user to pick and enter numbers from a display to win prizes.
! The way the game works is described in the instructions below. Set output window to
! times new roman, font 10, bold. I saved it this way but it might not show like that when you get it.
! The following are the commands used to create this game: input prompt, set mode for graphics,
! set window, let, ratio, set color, box (lines, circles, ellipses, squares), flood color, plot text,
! elseif, print, do-loop, sound, subroutines, input of string and number variables, draw lines, read data,
! open file, end
SET MODE "GRAPHICS"
LET Ratio = 1.4
SET WINDOW -100, (100*Ratio), -75, 100
SET COLOR "Cyan"
PLOT TEXT, AT 50, 88: " ~ ~ ~ LUCKY CARDS ~ ~ ~ "
PRINT
PRINT
PRINT
SET COLOR "magenta"
PRINT " Welcome to ~LUCKY CARDS~ ! "
INPUT prompt " Before we begin, please enter your name: ": Name$
PRINT
PRINT " Here we go, hope you are ready!"
PRINT
PRINT
SET COLOR "blue"
PRINT "Here are the instructions, please read them carefully before you begin: "
PRINT
PRINT " There are three figures that will be used in this game."
PRINT " You are the green circle."
PRINT " The red square is called Redd and it takes"
PRINT " your prizes when it lands in the same prize"
PRINT " category as you. (e.g. if green moves to $1 but then Redd"
PRINT " moves to $1 too, then you loose your $1). If you choose a specific number "
PRINT " where Redd appears, you lose it all and the"
PRINT " game is over. However, if your green circle lands on Win! (even on"
PRINT " the first try) you win and the game is over."
PRINT " The brown ellipse is called Brownn and it also takes your prizes like"
PRINT " Redd but Brownn gives them to charity. The objective of the game"
PRINT " is to win prizes, and get to the Win! line before prizes are taken away"
PRINT " by Redd or Brownn. You will have the chance to choose between"
PRINT " keeping your prizes and stop playing or keep going to get more prizes"
PRINT " with the risk of prizes being taken away. Not all numbers get you a prize. "
PRINT " You will be prompted to choose a number to uncover which figure advances and you"
PRINT " can choose whether to continue playing or stop by entering zero."
PRINT " Let's begin! "
! cyan squares
BOX LINES 5, 25, 55 , 75
SET COLOR "cyan"
FLOOD 20, 60
PLOT TEXT, AT 15, 52: "1"
BOX LINES 30, 50, 55, 75
SET COLOR "cyan"
FLOOD 40, 60
PLOT TEXT, AT 40, 52: "2"
BOX LINES 55, 75, 55, 75
SET COLOR "cyan"
FLOOD 60, 60
PLOT TEXT, AT 65, 52: "3"
BOX LINES 80, 100, 55, 75
SET COLOR "cyan"
FLOOD 85, 60
PLOT TEXT, AT 90, 52: "4"
BOX LINES 105, 125, 55, 75
SET COLOR "cyan"
FLOOD 110, 60
PLOT TEXT, AT 115, 52: "5"
BOX LINES 5, 25 , 30, 50
SET COLOR "cyan"
FLOOD 15, 40
PLOT TEXT, AT 15, 27: "6"
BOX LINES 30, 50, 30, 50
SET COLOR "cyan"
FLOOD 40, 40
PLOT TEXT, AT 40, 27: "7"
BOX LINES 55, 75, 30, 50
SET COLOR "cyan"
FLOOD 60, 40
PLOT TEXT, AT 65, 27: "8"
BOX LINES 80, 100, 30, 50
SET COLOR "cyan"
FLOOD 85, 40
PLOT TEXT, AT 90, 27: "9"
BOX LINES 105, 125, 30, 50
SET COLOR "cyan"
FLOOD 110, 40
PLOT TEXT, AT 115, 27: "10"
! figures in game
BOX CIRCLE 3, 11, 2, 9
SET COLOR "green"
FLOOD 5, 5
BOX ELLIPSE 2, 14 , -9, -3
SET COLOR "brown"
FLOOD 5, -7
BOX LINES 2, 14, -18, -13
SET COLOR "red"
FLOOD 5, -16
SET COLOR "black"
! horizontal lines on path
PLOT LINES: 0, 10; 125, 10
PLOT LINES: 0, 0; 125, 0
PLOT LINES: 0, -10; 125, -10
PLOT LINES: 0, -20; 125, -20
! vertical lines on path
PLOT LINES: 25, -20; 25, 15
PLOT LINES: 50, -20; 50, 15
PLOT LINES: 75, -20; 75, 15
PLOT LINES: 100, -20; 100, 15
SET COLOR "magenta"
PLOT LINES: 125, -20; 125, 10
! text on prizes you get
PLOT TEXT, AT 28, 17: "*$1.00*"
PLOT TEXT, AT 48, 17: "*2 Movie"
PLOT TEXT, AT 53, 15: "Tickets*"
PLOT TEXT, AT 75, 17: "*Trip to"
PLOT TEXT, AT 77, 15: "Canada*"
PLOT TEXT, AT 103, 17: "*$10,000*"
! major prize a surprise
SET COLOR "magenta"
PLOT TEXT, AT 127, -4: "YOU"
PLOT TEXT, AT 128, -6: "WIN !"
! User enters number
PRINT
DO
SET COLOR "black"
INPUT prompt "Your Choice? (enter number): ": Choice
IF Choice = 1 then
BOX CIRCLE 10, 20, 60, 70
SET COLOR "green"
FLOOD 15, 65
BOX KEEP 3, 11, 2, 9 in Figure$
BOX CLEAR 3, 11, 2, 9
BOX SHOW Figure$ at 29, 2
PRINT "You advance one unit!"
PRINT "If you want to continue enter next choice or enter zero to stop."
SOUND 1500, 0.5
ELSEIF Choice = 3 then
BOX CIRCLE 60, 70, 60, 70
SET COLOR "green"
FLOOD 65, 65
SOUND 1500, 0.5
BOX KEEP 3, 11, 2, 9 in Figure$
BOX CLEAR 3, 11, 2, 9
BOX SHOW Figure$ at 57, 2
PRINT "Yeah! you advance."
ELSEIF Choice = 7 then
BOX CIRCLE 35, 45, 35, 45
SET COLOR "green"
FLOOD 40, 40
SOUND 1500, 0.5
BOX KEEP 3, 11, 2, 9 in Figure$
BOX CLEAR 3, 11, 2, 9
BOX SHOW Figure$ at 126, -2
PRINT "Congratulations!";Name$
PRINT "You Have just won a luxury car! Call 123-45-67 to redeem your prize."
EXIT DO
ELSEIF Choice = 10 then
BOX CIRCLE 110, 120, 35, 45
SET COLOR "green"
FLOOD 115, 40
SOUND 1500, 0.5
BOX KEEP 3, 11, 2, 9 in Figure$
BOX CLEAR 3, 11, 2, 9
BOX SHOW Figure$ at 108, 2
PRINT "You advance!"
ELSEIF Choice = 2 then
BOX LINES 33, 47, 61, 69
SET COLOR "red"
FLOOD 40, 65
BOX KEEP 2, 14, -18, -13 in J$
BOX CLEAR 2, 14, -18, -13
BOX SHOW J$ at 80, -17
PRINT "Sorry, looks like Redd advances this time."
PRINT "Do you want to continue or stop?"
SOUND 1000, 0.5
ELSEIF Choice = 8 then
BOX LINES 58, 72, 35, 43
SET COLOR "red"
FLOOD 60, 40
BOX KEEP 2, 14, -18, -13 in J$
BOX CLEAR 2, 14, -18, -13
BOX SHOW J$ at 29, -17
PRINT "No! Redd advances."
SOUND 1000, 0.5
ELSEIF Choice = 9 then
BOX LINES 82, 96, 35, 43
SET COLOR "red"
FLOOD 92, 40
BOX KEEP 2, 14, -18, -13 in J$
BOX CLEAR 2, 14, -18, -13
BOX SHOW J$ at 126, -2
PRINT "Sorry, you lose it all. Redd keeps your prizes."
SOUND 1000, 0.5
EXIT DO
ELSEIF Choice = 5 then
BOX ELLIPSE 107, 123, 58, 68
SET COLOR "brown"
FLOOD 115, 60
BOX KEEP 2, 14 , -9, -3 in T$
BOX CLEAR 2, 14, -9, -3
BOX SHOW T$ at 80, -7
PRINT "Brownn advances."
SOUND 900, 0.4
ELSEIF Choice = 4 then
BOX ELLIPSE 82, 98, 58, 68
SET COLOR "brown"
FLOOD 88, 60
BOX KEEP 2, 14 , -9, -3 in T$
BOX CLEAR 2, 14, -9, -3
BOX SHOW T$ at 126, -2
PRINT "Sorry, you lose it all. Brownn will donate your prizes to charity."
SOUND 900, 0.4
EXIT DO
ELSEIF Choice = 6 then
BOX ELLIPSE 7, 23, 35, 45
SET COLOR "brown"
FLOOD 14, 40
BOX KEEP 2, 14 , -9, -3 in T$
BOX CLEAR 2, 14, -9, -3
BOX SHOW T$ at 55, -7
PRINT "Looks like Brownn moves one unit."
SOUND 900, 0.4
ELSEIF Choice = 0 then
SET COLOR "blue"
PRINT "Thank you for playing,"
PRINT "we will send your prizes soon. See you next time!"
EXIT DO
ELSE
PRINT "Invalid Choice"
END IF
LOOP
PRINT
PRINT
PRINT "If you would like to see how many people have won this game, type in winners.dat"
!commenting this part out so you don't have to download the winners file from the webpage
!INPUT prompt "Filename? ": Filename$
!OPEN #1: name Filename$
!Do while more #1
! INPUT #1: name$
! PRINT Name$
!LOOP
!PRINT "Give us a call if you would like to contact these winners (123-45.67)."
PRINT "Hope you had fun, see you next time."
END