Advertisement
Guest User

Magical Hrefneffer Whoopnuggets Part 2: Electric Boogaloo

a guest
Jun 15th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.72 KB | None | 0 0
  1. %%%Don't expect me to know who I am%%%
  2. %%%%%%%%%%%%JAMES SAMPSON%%%%%%%%%%%%
  3. %%%%%%Code by The Man Downstairs%%%%%%
  4.  
  5. var weather : int %The weather in actuality
  6. var events : int %This runs probability through a random number generator
  7. var money : real %Obvy
  8. var weatherForecast : int %The weather according to the forecast, 60% of the time, its right every time
  9. var cupsPrice : real %preset value; cups
  10. var sugarPrice : real %preset value; sugar
  11. var lemonsPrice : real %preset value; lemons
  12. var cups : int %num of cups
  13. var sugar : int %vol of sugar
  14. var lemons : int %num of lemons
  15. var itemPurchase : int
  16. var buy : string
  17. var averageTemp : int
  18. var enter : string
  19. var lemonadeCost : real
  20.  
  21. % Beginning sequence %
  22. put "Welcome to the lemonade stand game!"
  23. drawfillbox (12, 0, 32, 150, 186)
  24. drawfillbox (593, 0, 613, 150, 186)
  25. drawfillbox (27, 0, 47, 45, 114)
  26. drawfillbox (578, 0, 598, 45, 114)
  27. drawline (25, 45, 10, 150, 114)
  28. drawline (10, 150, 615, 150, 114)
  29. drawline (615, 150, 600, 45, 114)
  30. drawline (600, 45, 25, 45, 114)
  31. drawfill (140, 140, 114, 114)
  32. drawfilloval (110, 90, 45, 35, 44)
  33. drawfilloval (65, 90, 7, 6, 44)
  34. drawfilloval (155, 90, 7, 6, 44)
  35. put "How much money do you want to start with?"
  36. get money
  37. put "Just kidding!"
  38. money := 30
  39. put "You will start with 30 dollars."
  40. delay (1500)
  41. cls
  42.  
  43. cups := 0
  44. sugar := 0
  45. lemons := 0
  46.  
  47. put "Here's how this whole operation breaks down, chief."
  48. put "You'll use the enter button to progress through "
  49. put "these instructions."
  50. get enter
  51. put "Good! Now, this starts out with you buying supplies."
  52. put "You need 1 paper cup, 1 cup of sugar, and 1 lemon for"
  53. put "1 cup of lemonade."
  54. get enter
  55. put "Next, you'll receive the weather forecast, to help "
  56. put "you get an idea of how warm it'll be. However, the "
  57. put "forecast may be wrong."
  58. get enter
  59. put "At this point, you set the day's lemonade price."
  60. get enter
  61. put "After this, the true weather will be revealed like "
  62. put "my work ethic at 4am after a good cry following the"
  63. put ".txt file writeup I did failed to save and the computer"
  64. put "then crashed. Unfortunately, much like how the best-"
  65. put "laid text files of mice and men often go unsaved, the"
  66. put "true weather dictates how many customers you will get."
  67.  
  68. %%% Begin buy dialogues %%%
  69. loop
  70. cls
  71. %%%%% Buy display %%%%%
  72. delay (10)
  73. drawfillbox (0, 0, 680, 170, 118)
  74. drawfillbox (12, 0, 32, 150, 186)
  75. drawfillbox (593, 0, 613, 150, 186)
  76. drawfillbox (27, 0, 47, 45, 114)
  77. drawfillbox (578, 0, 598, 45, 114)
  78. drawline (25, 45, 10, 150, 114)
  79. drawline (10, 150, 615, 150, 114)
  80. drawline (615, 150, 600, 45, 114)
  81. drawline (600, 45, 25, 45, 114)
  82. drawfill (140, 140, 114, 114)
  83. drawfilloval (110, 90, 45, 35, 44)
  84. drawfilloval (65, 90, 7, 6, 44)
  85. drawfilloval (155, 90, 7, 6, 44)
  86. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  87. put "Buy? y/n?"
  88. get buy
  89. if buy = "y" then
  90. put "okay"
  91. delay (1500)
  92. cls
  93. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  94. put "What do you want to purchase?"
  95. put "You need at least one cup, one lemon, and one cup of sugar to make a cup of lemonade."
  96. put "Cups: code 1; sugar: code 2; lemons: code 3."
  97. get itemPurchase
  98. if itemPurchase = 1 then
  99. put "Okay, you're purchasing cups."
  100. delay (500)
  101. put "100 cups........$5.00"
  102. delay (500)
  103. money := (money - 5)
  104. cups := (cups + 100)
  105. elsif itemPurchase = 2 then
  106. put "Okay, you're purchasing sugar."
  107. delay (500)
  108. put "60 cups sugar...$8.00"
  109. delay (500)
  110. money := (money - 8)
  111. sugar := (sugar + 60)
  112. elsif itemPurchase = 3 then
  113. put "Okay, you're purchasing lemons."
  114. delay (500)
  115. put "30 lemons.......$4.00"
  116. delay (500)
  117. money := (money - 4)
  118. lemons := (lemons + 30)
  119. else
  120. put "I didn't understand that. 1, 2, or 3?"
  121. end if
  122. elsif buy = "n" then
  123. put "darn"
  124. delay (500)
  125. else
  126. put "I didn't understand that. y/n?"
  127. delay (1000)
  128. end if
  129. exit when buy = "n"
  130. end loop
  131.  
  132. %%% The absolute POWER of this lad %%%
  133. cls
  134. %%%%% Dashboard %%%%%
  135. delay (10)
  136. drawfillbox (0, 0, 680, 170, 118)
  137. drawfillbox (12, 0, 32, 150, 186)
  138. drawfillbox (593, 0, 613, 150, 186)
  139. drawfillbox (27, 0, 47, 45, 114)
  140. drawfillbox (578, 0, 598, 45, 114)
  141. drawline (25, 45, 10, 150, 114)
  142. drawline (10, 150, 615, 150, 114)
  143. drawline (615, 150, 600, 45, 114)
  144. drawline (600, 45, 25, 45, 114)
  145. drawfill (140, 140, 114, 114)
  146. drawfilloval (110, 90, 45, 35, 44)
  147. drawfilloval (65, 90, 7, 6, 44)
  148. drawfilloval (155, 90, 7, 6, 44)
  149. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  150. put "The weather forecast is here."
  151. %%%% Weather event %%%%
  152. randint (weather, 1, 25)
  153. randint (weatherForecast, 1, 6)
  154.  
  155. if weather <= 6 then
  156. weather := weather + weatherForecast
  157. elsif weather >= 20 then
  158. weather := weather - weatherForecast
  159. else
  160. if weatherForecast <= 2 then
  161. weatherForecast := weather - weatherForecast
  162. elsif weatherForecast >= 5 then
  163. weatherForecast := weather - weatherForecast
  164. else
  165. weatherForecast := weather
  166. end if
  167. end if
  168.  
  169. randint (averageTemp, 19, 24)
  170.  
  171. %%%% Specific days' predictions %%%%
  172. if weatherForecast = 1 then
  173. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  174. elsif weatherForecast = 2 then
  175. put "The forecast calls for ", (averageTemp - 1), " degree weather and broken clouds."
  176. elsif weatherForecast = 3 then
  177. put "The forecast calls for ", (averageTemp + 1), " degree weather and clear skies."
  178. elsif weatherForecast = 4 then
  179. put "The forecast calls for ", (averageTemp - 2), " degree weather and occasional clouds."
  180. elsif weatherForecast = 5 then
  181. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  182. elsif weatherForecast = 6 then
  183. put "The forecast calls for ", (averageTemp + 2), " degree weather and broken clouds."
  184. elsif weatherForecast = 7 then
  185. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  186. elsif weatherForecast = 8 then
  187. put "The forecast calls for ", (averageTemp - 3), " degree weather and clear skies."
  188. elsif weatherForecast = 9 then
  189. put "The forecast calls for ", (averageTemp + 3), " degree weather and occasional clouds."
  190. elsif weatherForecast = 10 then
  191. put "The forecast calls for ", (averageTemp - 4), " degree weather and broken clouds."
  192. elsif weatherForecast = 11 then
  193. put "The forecast calls for ", (averageTemp + 7), " degree weather, a bright sun, and humid air."
  194. elsif weatherForecast = 12 then
  195. put "The forecast calls for ", (averageTemp + 4), " degree weather and clear skies."
  196. elsif weatherForecast = 13 then
  197. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  198. elsif weatherForecast = 14 then
  199. put "The forecast calls for ", (averageTemp - 3), " degree weather and rain."
  200. elsif weatherForecast = 15 then
  201. put "The forecast calls for ", (averageTemp + 3), " degree weather and heavy clouds."
  202. elsif weatherForecast = 16 then
  203. put "The forecast calls for ", (averageTemp - 2), " degree weather and broken clouds."
  204. elsif weatherForecast = 17 then
  205. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  206. elsif weatherForecast = 18 then
  207. put "The forecast calls for ", (averageTemp + 2), " degree weather and clear skies."
  208. elsif weatherForecast = 19 then
  209. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  210. elsif weatherForecast = 20 then
  211. put "The forecast calls for ", (averageTemp - 1), " degree weather and cloudy."
  212. elsif weatherForecast = 21 then
  213. put "The forecast calls for ", (averageTemp + 1), " degree weather and rainy weather."
  214. elsif weatherForecast = 22 then
  215. put "The forecast calls for ", (averageTemp + 7), " degree weather, a bright sun, and humid air."
  216. elsif weatherForecast = 23 then
  217. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  218. elsif weatherForecast = 24 then
  219. put "The forecast calls for ", (averageTemp + 3), " degree weather."
  220. elsif weatherForecast = 25 then
  221. put "We are anticipating a tornado. Please remain inside."
  222. else
  223. put "An error occurred. Please reload this run window."
  224. end if
  225.  
  226. put "Now that you know the weather forecast, "
  227. put "it's time to set your lemonade price."
  228. get lemonadePrice
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement