Race Game

Author Message
fantasydealer

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 9/15/2006
  • Status: offline
Race Game Friday, September 15, 2006 7:58 PM (permalink)
0
 '==========================DEFINITIONS=============================
 '==================================================================
 Randomize  '-------------------------------------------------------Makes the interger picking Random.
 intrace1 = 0  '----------------------------------------------------Sets racer 1's points at Zero.
 intrace2 = 0  '----------------------------------------------------Sets racer 2's points at Zero.
 intmax = 100  '----------------------------------------------------Sets your starting money at 100.
 intbet = 0  '------------------------------------------------------Sets the bet at default 0.
 '==================================================================
 '==================================================================
 
 intchoice = InputBox("Pick a racer, 1 or 2")  '--------------------Lets you pick your racer.
 Call Bet()  '------------------------------------------------------Brings us to the Betting Sub.
 
 '==========================BETING SUB==============================
 '==================================================================
 Private Sub Bet()
   intrace1 = 0  '--------------------------------------------------Sets the points at zero for a new game.
   intrace2 = 0  '--------------------------------------------------Sets the points at zero for a new game.
   intbet = InputBox("Place your Bet, Max = " & intmax)  '----------Lets you place your bet, and shows your money.
   If int(intbet) > int(intmax) then Call Bet()  '------------------If your bet > money then it makes u bet again.
   Call Race()  '---------------------------------------------------
 End Sub
 '==================================================================
 '==================================================================
 
 '===========================Main Sub===============================
 '==================================================================
 Private Sub Race()
   intrace1 = intrace1 + int(rnd * 10) + 1  '-----------------------Adds random points between 1 and 10 to racer 1.
   intrace2 = intrace2 + int(rnd * 10) + 1  '-----------------------Adds random points between 1 and 10 to racer 2.
   If intrace1 > 50 then  '-----------------------------------------Sets the Finish point for racer 1 at 50 points.
     Call Car1()  '-------------------------------------------------Goes to the Racer 1 winning Sub.
     Exit Sub
   End If
   if intrace2 > 50 then  '-----------------------------------------Sets the Finish point for racer 1 at 50 points.
     Call Car2()  '-------------------------------------------------Goes to the Racer 2 winning Sub.
     Exit Sub
   End If
   MsgBox("Racer 1 = " & intrace1 & " Racer 2 = " & intrace2)  '----Shows the current points for each racer.
   Call Race()  '---------------------------------------------------Loops the Race Sub until a winner is reached.
 End Sub
 '==================================================================
 '==================================================================
 
 '==========================Car 1 Wins!=============================
 '==================================================================
 Private Sub Car1()
   MsgBox("Racer 1 wins!")  '---------------------------------------Displays a message that Racer 1 Won.
   If intchoice = 1 then intmax = int(intmax) + int(intbet)  '------Gives you money if u bet on Racer 1.
   If intchoice = 2 then intmax = int(intmax) - int(intbet)  '------Takes away money if u did not bet on Racer 1.
   intplay = inputbox("Do you want to play again? 1=Yes : 2=No")  '-Askes u if u want to play again.
   if intplay = 1 then Call Bet()  '--------------------------------Brings you back to the Betting sub to play again.
 End Sub
 '==================================================================
 '==================================================================
 
 '=========================Car 2 Wins!==============================
 '==================================================================
 Private Sub Car2()
   MsgBox("Racer 2 Wins!")  '---------------------------------------Displays a message that Racer 2 Won.
   If intchoice = 2 then intmax = int(intmax) + int(intbet)  '------Gives you money if u bet on Racer 2.
   If intchoice = 1 then intmax = int(intmax) - int(intbet)  '------Takes away money if u did not bet on Racer 2.
   intplay = inputbox("Do you want to play again? 1=Yes : 2=No")  '-Askes u if u want to play again.
   If intplay = 1 then Call Bet()  '--------------------------------Brings you back to the Betting sub to play again.
 End Sub
 '==================================================================
 '==================================================================
 
 
 '======================================================================================================================
 '============================================Created By: FaNtAsY_DeAlEr================================================
 '======================================================================================================================
 'I know it is nothing special, and i went a little overboard on the explainations, but i was bored.
 'Feel free to add as much to this as you want, just give me some credit for getting it rolling thx.
 


I am so bored so i thought i might post this.
'========Random V.1=========
'========================
intrandom = int(rnd*10)+1
msgbox("Your number is" & intrandom)
'====Created By: FantasyDealer====
'=========================
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9