Awesome? Awww.
Here's something that may help. I coded it whilst I'm waiting for a meeting at work, it took less than an hour so I think I just broke a personal record! Woo!
Rem Project: Slot Machine
Rem Created: Friday, February 11, 2011
Rem Created By: Burningfeetman
Rem ***** Main Source File *****
Randomize Timer()
Sync Rate 60
Sync Sleep 1
Dim Result(3) `Remember that arrays also use 0. In this example we're not using it.
Do
Pull_Lever()
Print_Result()
Review_Results()
Sync
Wait Key
CLS
Loop
End
Function Pull_Lever()
For Slot = 1 to 3
Result(Slot) = Rnd(3-1)+1
Next Slot
EndFunction
Function Print_Result()
Set Cursor 50,200
Print Result(1)
Wait 500
Set Cursor 100,200
Print Result(2)
Wait 500
Set Cursor 150,200
Print Result(3)
Wait 500
EndFunction
Function Review_Results()
If Result(1) = Result(2) and Result(2) = Result(3)
Select Result(1)
Case 1:
Print " !!! CRAPSTICKS! 3 CHERRIES!"
EndCase
Case 2:
Print "Fffff! BANANA POWRAH!!!"
EndCase
Case 3:
Print "Zomg apples. :("
EndCase
Case Default
Print "Something has broken, you shouldn't be seeing this. >_>"
Wait key
EndCase
EndSelect
Else
Print "TRY AGAIN, SUCKA!!!"
Endif
Endfunction
In the code, I use functions, arrays, variables and a Select Case system. Please let me know if you need any of these explained. Hopefully it all makes sense though.
Oh, I've also attached a render of a 3D model that I'm working on too.
Help build an online DarkBASIC Professional help archive.
http://dbprohelp.wikia.com/wiki/DarkBASIC_Professional_Help_Wiki