SHARE
TWEET

Yolocoin Simulator sauce code

luckytyphlosion Nov 1st, 2015 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var odds : int := 1
  2. var command : string
  3. var balance : real := 0
  4. var username : string
  5. var initialDate : string
  6. var initialTime : string
  7. date(initialDate)
  8. time(initialTime)
  9.  
  10. proc doBegCommand
  11.     if odds = 0 and balance not = 0 then
  12.         put "Enough is enough. I'm halving your points, and don't expect any pity from me anytime soon."
  13.         balance := floor(balance/2)
  14.     else
  15.         var allowBeg : int
  16.         if odds = 0 then
  17.             odds := 1
  18.         end if
  19.         randint(allowBeg,1,odds)
  20.         var amount : int
  21.         var total : int := 0
  22.         loop
  23.             randint(amount,1,10)
  24.             total := total + amount
  25.             if amount not = 10 then
  26.                 exit
  27.             end if
  28.         end loop
  29.             put "Fine, have ",total," points."
  30.             balance := balance + total
  31.         if allowBeg not = 1 then
  32.             odds := 0
  33.         else
  34.             odds := odds + 1
  35.         end if
  36.     end if
  37. end doBegCommand
  38.  
  39. proc doYolocoinCommand
  40.     if balance = 0 then
  41.         put "No points to gamble"
  42.     else
  43.         var coinFlip : int
  44.         var tempusername : string
  45.         tempusername := Str.Upper(username)
  46.         if tempusername = "RXFADEZ" then
  47.             randint (coinFlip,1,4)
  48.         else
  49.             randint(coinFlip,1,2)
  50.         end if
  51.        
  52.         if coinFlip = 1 then
  53.             put "Heads. +",balance," points."
  54.             balance := balance*2
  55.         else
  56.             put "Tails. -",balance," points."
  57.             var newDate : string
  58.             var newTime : string
  59.             date(newDate)
  60.             time(newTime)
  61.             put "RIP ",username,initialDate,",",initialTime," -",newDate,",",newTime,"."
  62.             initialDate := newDate
  63.             initialTime := newTime
  64.             if tempusername = "RXFADEZ" then
  65.                 put "Totally not rigged Kappa."
  66.             end if
  67.             balance := 0
  68.             odds := 1
  69.         end if
  70.     end if
  71. end doYolocoinCommand
  72.  
  73. put "Enter username"
  74. get username
  75. put ""
  76. put "Welcome to Yolocoin Simulator v0.6.9"
  77. put "Type !help for a list of commands."
  78. loop
  79.     get command
  80.     case command of
  81.         label "!beg" : doBegCommand
  82.         label "!yolocoin" : doYolocoinCommand
  83.         label "!balance" : put "You have ",balance," points."
  84.         label "!help" : put "=============\r\n!beg: Free points, but don't get too greedy!\r\n!yolocoin: If heads, double points. If tails, rip them all.\r\n!balance: States your current balance.\r\n!ragequit: When you think this game is becoming too dumb.\r\n============="
  85.        label "!ragequit" : exit
  86.        label : put "Unknown Command"
  87.    end case
  88. end loop
  89. put "Get rekt son"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top