I have been trying to figure this challenge out now for 2 days. It walked me through creating a simple slot machine program. Original code here
`Assign ten dollars to the player's account
AccountBalance = 10
CLS RGB(255, 255, 255)
SET TEXT FONT "Arial"
SET TEXT SIZE 48
ForegroundColor = RGB(0, 0, 160)
BackgroundColor = RGB(255, 255, 255)
INK ForegroundColor, BackgroundColor
CENTER TEXT 320, 150, "Welcome to The"
CENTER TEXT 320, 220, "Slot Machine Game"
SET TEXT SIZE 18
CENTER TEXT 320, 380, "Press any key to continue."
WAIT KEY
CLS RGB(255, 255, 255)
SET TEXT SIZE 24
TEXT 100, 120, "Instructions:"
TEXT 100, 160, "Press any key to place a bet."
TEXT 100, 190, "3 of a kind adds 2 dollars to your account"
TEXT 100, 220, "2 of a kind adds 1 dollar to your account"
TEXT 100, 250, "No matches subtracts 3 dollars from your account"
SET TEXT SIZE 18
CENTER TEXT 320, 380, "Press any key to continue"
WAIT KEY
do
FOR i = 1 TO 40 `Iterate nineteen times
ForegroundColor = RGB(0, 0, 160)
BackgroundColor = RGB(255, 255, 255)
INK ForegroundColor, BackgroundColor
CLS RGB(255, 255, 255)
SET TEXT SIZE 24
`Display the player account balance
TEXT 75, 30, "Account Balance: " + STR$(AccountBalance)
SET TEXT SIZE 36
CENTER TEXT 320, 90, "___________________________"
SET TEXT SIZE 72
`Display random numbers representing slot machines dials
CENTER TEXT 320, 150, STR$(RND(2) + 1) + " " + STR$(RND(2) + 1) + " " + STR$(RND(2) + 1)
SET TEXT SIZE 36
CENTER TEXT 320, 210, "___________________________"
SLEEP 50 `Pause game execution for a fifth of a second
NEXT i
SET TEXT SIZE 72
CLS RGB(255, 255, 255)
`Generate the final set of numbers representing dial values
DialOne = RND(2) + 1
DialTwo = RND(2) + 1
DialThree = RND(2) + 1
SET TEXT SIZE 36
CENTER TEXT 320, 90, "___________________________"
SET TEXT SIZE 72
`Display random numbers representing slot machine dials
CENTER TEXT 320, 150, STR$(DialOne) + " " + STR$(DialTwo) + " " + STR$(DialThree)
SET TEXT SIZE 36
CENTER TEXT 320, 210, "___________________________"
`Add up the final result for each dial
Result = DialOne + DialTwo + DialThree
SET TEXT SIZE 36
`Look for a jackpot made up of 3 ones or 3 threes
IF (Result = 3) OR (Result = 9)
CENTER TEXT 320, 260, "Three of a kind - Jackpot!"
`Add 2 dollars to the player's account
AccountBalance = AccountBalance + 2
ENDIF
`Look for a jackpot made up of 3 twos
IF Result = 6
IF DialOne = DialTwo `There are 3 twos
CENTER TEXT 320, 260, "Three of a kind - Jackpot!"
`Add 2 dollars to the player's account
AccountBalance = AccountBalance + 2
ELSE
`Look to see if a one, two, and three were generated
CENTER TEXT 320, 260, "No matches - You Lose!"
`Subtract 3 dollars from the player's account
AccountBalance = AccountBalance - 3
ENDIF
ENDIF
`Anything other than 3, 6, or 9 means a pair was generated
IF (Result <> 3) AND (Result <> 6) AND (Result <> 9)
CENTER TEXT 320, 260, "Two of a kind - Winner!"
`Add 1 dollar to the player's account
AccountBalance = AccountBalance + 1
ENDIF
SET TEXT SIZE 24
`Display the player account balance
TEXT 75, 30, "Account Balance: " + STR$(AccountBalance)
SET TEXT SIZE 18
`Display instructions for continuing
CENTER TEXT 320, 420, "Press Escape to quit or any other key to continue."
`End game play if the player has gone broke
IF AccountBalance <= 0
SET TEXT SIZE 24
ForegroundColor = RGB(255, 0, 0)
BackgroundColor = RGB(255, 255, 255)
INK ForegroundColor, BackgroundColor `Apply color settings
`Notify the player that the game is over
CENTER TEXT 320, 310, "G A M E O V E R"
CENTER TEXT 320, 350, "You have gone broke!"
WAIT KEY
EXIT `Terminate the loop
ENDIF
WAIT KEY
loop
CLS RGB(255, 255, 255)
ForegroundColor = RGB(0, 0, 160)
INK ForegroundColor, BackgroundColor `Apply color settings
SET TEXT SIZE 24
`Display the game's closing message
CENTER TEXT 320, 150, "Thanks for playing the Slot Machine Game!"
SET TEXT SIZE 16
CENTER TEXT 320, 240, "Developed by Jerry Lee Ford, Jr."
CENTER TEXT 320, 260, "Copyright 2008"
CENTER TEXT 320, 280, "http://www.tech-publishing.com"
SET TEXT SIZE 18
CENTER TEXT 320, 380, "Press any key to end game."
WAIT KEY
END
Then it challenged me to change the dial numbers from 1 through 3 to 1 through 5.
Here is what I have and as you can see when you run it, it will land on a jackpot and display all msges:
Rem Project: slotmachine5s
Rem Created: Sunday, March 28, 2010
Rem ***** Main Source File *****
REM Version: 1.0
REM Author: Scott Watkins
REM Description: This DarkBASIC Professional game simulates a Las Vegas
REM Slot Machine
`Assign ten dollars to the player's account
AccountBalance = 10
CLS RGB(255, 255, 255)
SET TEXT FONT "Arial"
SET TEXT SIZE 48
ForegroundColor = RGB(0, 0, 160)
BackgroundColor = RGB(255, 255, 255)
INK ForegroundColor, BackgroundColor
CENTER TEXT 320, 150, "Welcome to The"
CENTER TEXT 320, 220, "Slot Machine Game"
SET TEXT SIZE 18
CENTER TEXT 320, 380, "Press any key to continue."
WAIT KEY
CLS RGB(255, 255, 255)
SET TEXT SIZE 24
TEXT 100, 120, "Instructions:"
TEXT 100, 160, "Press any key to place a bet."
TEXT 100, 190, "3 of a kind adds 2 dollars to your account"
TEXT 100, 220, "2 of a kind adds 1 dollar to your account"
TEXT 100, 250, "No matches subtracts 3 dollars from your account"
SET TEXT SIZE 18
CENTER TEXT 320, 380, "Press any key to continue"
WAIT KEY
do
FOR i = 1 TO 30 `Iterate nineteen times
ForegroundColor = RGB(0, 0, 160)
BackgroundColor = RGB(255, 255, 255)
INK ForegroundColor, BackgroundColor
CLS RGB(255, 255, 255)
SET TEXT SIZE 24
`Display the player account balance
TEXT 75, 30, "Account Balance: " + STR$(AccountBalance)
SET TEXT SIZE 36
CENTER TEXT 320, 90, "___________________________"
SET TEXT SIZE 72
`Display random numbers representing slot machines dials
CENTER TEXT 320, 150, STR$(RND(4) + 1) + " " + STR$(RND(4) + 1) + " " + STR$(RND(4) + 1)
SET TEXT SIZE 36
CENTER TEXT 320, 210, "___________________________"
SLEEP 200 `Pause game execution for a fifth of a second
NEXT i
SET TEXT SIZE 72
CLS RGB(255, 255, 255)
`Generate the final set of numbers representing dial values
DialOne = RND(4) + 1
DialTwo = RND(4) + 1
DialThree = RND(4) + 1
SET TEXT SIZE 36
CENTER TEXT 320, 90, "___________________________"
SET TEXT SIZE 72
`Display random numbers representing slot machine dials
CENTER TEXT 320, 150, STR$(DialOne) + " " + STR$(DialTwo) + " " + STR$(DialThree)
SET TEXT SIZE 36
CENTER TEXT 320, 210, "___________________________"
`Add up the final result for each dial
result = dialone + dialtwo + dialthree
SET TEXT SIZE 36
`Look for a jackpot
IF dialone = dialtwo and dialtwo = dialthree
CENTER TEXT 320, 260, "Three of a kind - Jackpot!"
`Add 2 dollars to the player's account
AccountBalance = AccountBalance + 2
ENDIF
`Look for two of a kind
IF dialone = dialtwo and dialthree <> dialone or dialone = dialthree and dialtwo <> dialone or dialthree = dialtwo and dialone <> dialthree
CENTER TEXT 320, 260, "Two of a kind - Winner!"
`Add 2 dollars to the player's account
AccountBalance = AccountBalance + 1
ELSE
CENTER TEXT 320, 260, "No matches - You Lose!"
`Subtract 3 dollars from the player's account
AccountBalance = AccountBalance - 3
endif
SET TEXT SIZE 24
`Display the player account balance
TEXT 75, 30, "Account Balance: " + STR$(AccountBalance)
SET TEXT SIZE 18
`Display instructions for continuing
CENTER TEXT 320, 420, "Press Escape to quit or any other key to continue."
`End game play if the player has gone broke
IF AccountBalance <= 0
SET TEXT SIZE 24
ForegroundColor = RGB(255, 0, 0)
BackgroundColor = RGB(255, 255, 255)
INK ForegroundColor, BackgroundColor `Apply color settings
`Notify the player that the game is over
CENTER TEXT 320, 310, "G A M E O V E R"
CENTER TEXT 320, 350, "You have gone broke!"
WAIT KEY
EXIT `Terminate the loop
ENDIF
WAIT KEY
loop
CLS RGB(255, 255, 255)
ForegroundColor = RGB(0, 0, 160)
INK ForegroundColor, BackgroundColor `Apply color settings
SET TEXT SIZE 24
`Display the game's closing message
CENTER TEXT 320, 150, "Thanks for playing the Slot Machine Game!"
SET TEXT SIZE 16
CENTER TEXT 320, 240, "Developed by Jerry Lee Ford, Jr."
CENTER TEXT 320, 260, "Copyright 2008"
CENTER TEXT 320, 280, "http://www.tech-publishing.com"
SET TEXT SIZE 18
CENTER TEXT 320, 380, "Press any key to end game."
WAIT KEY
END
Can you guys tell me where I'm going wrong?