Advertisement
Guest User

Magical Hrefneffer Whoopnuggets 6: Re-revenge of the 6th

a guest
Jun 16th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.24 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 %confirms purchase of an item
  16. var buy : string %a pseudoboolean string variable
  17. var averageTemp : int %average temperature, off of which warm/cold is based
  18. var enter : string %...the enter key...
  19. var lemonadeCost : real %don't make me explain this
  20. var dieSix : int %randint from 1 to 6
  21. var customers : real %rough number of customers
  22. var days : int %what day the program is on.
  23. var materialsGet : string %do we have enough materials?
  24. var didWeWin : string %did we win?
  25.  
  26. % Beginning sequence %
  27. put "Welcome to the lemonade stand game!"
  28. drawfillbox (12, 0, 32, 150, 186)
  29. drawfillbox (593, 0, 613, 150, 186)
  30. drawfillbox (27, 0, 47, 45, 114)
  31. drawfillbox (578, 0, 598, 45, 114)
  32. drawline (25, 45, 10, 150, 114)
  33. drawline (10, 150, 615, 150, 114)
  34. drawline (615, 150, 600, 45, 114)
  35. drawline (600, 45, 25, 45, 114)
  36. drawfill (140, 140, 114, 114)
  37. drawfilloval (110, 90, 45, 35, 44)
  38. drawfilloval (65, 90, 7, 6, 44)
  39. drawfilloval (155, 90, 7, 6, 44)
  40. put "How much money do you want to start with?"
  41. get money
  42. put "Just kidding!"
  43. money := 30
  44. put "You will start with 30 dollars."
  45. delay (1500)
  46. cls
  47.  
  48. cups := 0
  49. sugar := 0
  50. lemons := 0
  51.  
  52. put "Here's how this whole operation breaks down, chief."
  53. put "You'll use the enter button to progress through "
  54. put "these instructions."
  55. get enter
  56. put "Good! Now, this starts out with you buying supplies."
  57. put "You need 1 paper cup, 1 cup of sugar, and 1 lemon for"
  58. put "1 cup of lemonade."
  59. get enter
  60. put "Next, you'll receive the weather forecast, to help "
  61. put "you get an idea of how warm it'll be. However, the "
  62. put "forecast may be wrong."
  63. get enter
  64. put "At this point, you set the day's lemonade price."
  65. get enter
  66. put "After this, the true weather will be revealed like "
  67. put "my work ethic at 4am after a good cry following the"
  68. put ".txt file writeup I did failed to save and the computer"
  69. put "then crashed. Unfortunately, much like how the best-"
  70. put "laid text files of mice and men often go unsaved, the"
  71. put "true weather dictates how many customers you will get."
  72. get enter
  73.  
  74.  
  75. loop
  76. %%% Begin buy dialogues %%%
  77. loop
  78. cls
  79. %%%%% Buy display %%%%%
  80. delay (10)
  81. drawfillbox (0, 0, 680, 170, 118)
  82. drawfillbox (12, 0, 32, 150, 186)
  83. drawfillbox (593, 0, 613, 150, 186)
  84. drawfillbox (27, 0, 47, 45, 114)
  85. drawfillbox (578, 0, 598, 45, 114)
  86. drawline (25, 45, 10, 150, 114)
  87. drawline (10, 150, 615, 150, 114)
  88. drawline (615, 150, 600, 45, 114)
  89. drawline (600, 45, 25, 45, 114)
  90. drawfill (140, 140, 114, 114)
  91. drawfilloval (110, 90, 45, 35, 44)
  92. drawfilloval (65, 90, 7, 6, 44)
  93. drawfilloval (155, 90, 7, 6, 44)
  94. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  95. put "Buy? y/n?"
  96. get buy
  97. if buy = "y" then
  98. put "okay"
  99. delay (1500)
  100. cls
  101. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  102. put "What do you want to purchase?"
  103. put "You need at least one cup, one lemon, and one cup of sugar to make a cup of lemonade."
  104. put "Cups: code 1; sugar: code 2; lemons: code 3."
  105. get itemPurchase
  106. if itemPurchase = 1 then
  107. if money < 5
  108. put "Sorry, you don't have enough money to buy that!"
  109. else
  110. put "Okay, you're purchasing cups."
  111. delay (500)
  112. put "100 cups........$5.00"
  113. delay (500)
  114. money := (money - 5)
  115. cups := (cups + 100)
  116. end if
  117. elsif itemPurchase = 2 then
  118. if money < 8 then
  119. put "Sorry, you don't have enough money to buy that!"
  120. else
  121. put "Okay, you're purchasing sugar."
  122. delay (500)
  123. put "60 cups sugar...$8.00"
  124. delay (500)
  125. money := (money - 8)
  126. sugar := (sugar + 60)
  127. end if
  128. elsif itemPurchase = 3 then
  129. if money < 4 then
  130. put "Sorry, you don't have enough money to buy that!"
  131. else
  132. put "Okay, you're purchasing lemons."
  133. delay (500)
  134. put "30 lemons.......$4.00"
  135. delay (500)
  136. money := (money - 4)
  137. lemons := (lemons + 30)
  138. end if
  139. else
  140. put "I didn't understand that. 1, 2, or 3?"
  141. end if
  142. elsif buy = "n" then
  143. put "darn"
  144. delay (500)
  145. else
  146. put "I didn't understand that. y/n?"
  147. delay (1000)
  148. end if
  149. exit when buy = "n"
  150. end loop
  151.  
  152. %%% The absolute POWER of this lad %%%
  153. cls
  154. %%%%% Dashboard %%%%%
  155. delay (10)
  156. drawfillbox (0, 0, 680, 170, 118)
  157. drawfillbox (12, 0, 32, 150, 186)
  158. drawfillbox (593, 0, 613, 150, 186)
  159. drawfillbox (27, 0, 47, 45, 114)
  160. drawfillbox (578, 0, 598, 45, 114)
  161. drawline (25, 45, 10, 150, 114)
  162. drawline (10, 150, 615, 150, 114)
  163. drawline (615, 150, 600, 45, 114)
  164. drawline (600, 45, 25, 45, 114)
  165. drawfill (140, 140, 114, 114)
  166. drawfilloval (110, 90, 45, 35, 44)
  167. drawfilloval (65, 90, 7, 6, 44)
  168. drawfilloval (155, 90, 7, 6, 44)
  169. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  170. put "The weather forecast is here."
  171.  
  172. %%%% Weather event %%%%
  173. randint (weather, 1, 25)
  174. randint (weatherForecast, 1, 6)
  175. if weather <= 6 then
  176. weather := weather + weatherForecast
  177. elsif weather >= 20 then
  178. weather := weather - weatherForecast
  179. else
  180. if weatherForecast <= 2 then
  181. weatherForecast := weather - weatherForecast
  182. elsif weatherForecast >= 5 then
  183. weatherForecast := weather - weatherForecast
  184. else
  185. weatherForecast := weather
  186. end if
  187. end if
  188.  
  189. %%%%% Set average temperature %%%%%
  190. randint (averageTemp, 19, 24)
  191. days := 1
  192.  
  193. %%%% Specific days' predictions %%%%
  194. if weatherForecast = 1 then
  195. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  196. elsif weatherForecast = 2 then
  197. put "The forecast calls for ", (averageTemp - 1), " degree weather and broken clouds."
  198. elsif weatherForecast = 3 then
  199. put "The forecast calls for ", (averageTemp + 1), " degree weather and clear skies."
  200. elsif weatherForecast = 4 then
  201. put "The forecast calls for ", (averageTemp - 2), " degree weather and occasional clouds."
  202. elsif weatherForecast = 5 then
  203. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  204. elsif weatherForecast = 6 then
  205. put "The forecast calls for ", (averageTemp + 2), " degree weather and broken clouds."
  206. elsif weatherForecast = 7 then
  207. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  208. elsif weatherForecast = 8 then
  209. put "The forecast calls for ", (averageTemp - 3), " degree weather and clear skies."
  210. elsif weatherForecast = 9 then
  211. put "The forecast calls for ", (averageTemp + 3), " degree weather and occasional clouds."
  212. elsif weatherForecast = 10 then
  213. put "The forecast calls for ", (averageTemp - 4), " degree weather and broken clouds."
  214. elsif weatherForecast = 11 then
  215. put "The forecast calls for ", (averageTemp + 7), " degree weather, a bright sun, and humid air."
  216. elsif weatherForecast = 12 then
  217. put "The forecast calls for ", (averageTemp + 4), " degree weather and clear skies."
  218. elsif weatherForecast = 13 then
  219. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  220. elsif weatherForecast = 14 then
  221. put "The forecast calls for ", (averageTemp - 3), " degree weather and rain."
  222. elsif weatherForecast = 15 then
  223. put "The forecast calls for ", (averageTemp + 3), " degree weather and heavy clouds."
  224. elsif weatherForecast = 16 then
  225. put "The forecast calls for ", (averageTemp - 2), " degree weather and broken clouds."
  226. elsif weatherForecast = 17 then
  227. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  228. elsif weatherForecast = 18 then
  229. put "The forecast calls for ", (averageTemp + 2), " degree weather and clear skies."
  230. elsif weatherForecast = 19 then
  231. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  232. elsif weatherForecast = 20 then
  233. put "The forecast calls for ", (averageTemp - 1), " degree weather and cloudy."
  234. elsif weatherForecast = 21 then
  235. put "The forecast calls for ", (averageTemp + 1), " degree weather and rainy weather."
  236. elsif weatherForecast = 22 then
  237. put "The forecast calls for ", (averageTemp + 7), " degree weather, a bright sun, and humid air."
  238. elsif weatherForecast = 23 then
  239. put "The forecast calls for ", averageTemp, " degree weather and clear skies."
  240. elsif weatherForecast = 24 then
  241. put "The forecast calls for ", (averageTemp + 3), " degree weather."
  242. elsif weatherForecast = 25 then
  243. put "We are anticipating a tornado. Please remain inside."
  244. else
  245. put "An error occurred. Please reload this run window."
  246. end if
  247.  
  248. %%%%% Set lemonade price %%%%%
  249. put "Now that you know the weather forecast, "
  250. put "it's time to set your lemonade price."
  251. get lemonadePrice
  252. cls
  253.  
  254. %%%%%% Specific days' outcomes %%%%%%
  255. if weather = 1 then
  256. put "Today will be ", averageTemp, " degrees and clear skies."
  257. put "But that doesn't matter; your stand was bought by Mr. Moneybags."
  258. money := 1000000
  259. lemons := 0
  260. cups := 0
  261. sugar := 0
  262. delay (250)
  263. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  264. days := 30
  265. elsif weather = 2 then
  266. put "Today will be ", (averageTemp - 1), " degrees and broken clouds."
  267. randint (dieSix, 1, 6)
  268. customers := dieSix div (0.30 / lemonadePrice)
  269. loop
  270. cls
  271. customers := customers - 1
  272. money := money + lemonadePrice
  273. cups := cups - 1
  274. lemons := lemons - 1
  275. sugar := sugar - 1
  276. delay (250)
  277. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  278. exit when customers = 0
  279. end loop
  280. elsif weather = 3 then
  281. put "Today will be ", (averageTemp + 1), " degrees and clear skies."
  282. randint (dieSix, 1, 6)
  283. customers := dieSix div (0.20 / lemonadePrice)
  284. loop
  285. cls
  286. customers := customers - 1
  287. money := money + lemonadePrice
  288. cups := cups - 1
  289. lemons := lemons - 1
  290. sugar := sugar - 1
  291. delay (250)
  292. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  293. exit when customers = 0
  294. end loop
  295. elsif weather = 4 then
  296. put "Today will be ", (averageTemp - 2), " degrees and occasional clouds."
  297. randint (dieSix, 1, 6)
  298. customers := dieSix div (0.35 / lemonadePrice)
  299. loop
  300. cls
  301. customers := customers - 1
  302. money := money + lemonadePrice
  303. cups := cups - 1
  304. lemons := lemons - 1
  305. sugar := sugar - 1
  306. delay (250)
  307. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  308. exit when customers = 0
  309. end loop
  310. elsif weather = 5 then
  311. put "Today will be ", averageTemp, " degrees and clear skies."
  312. randint (dieSix, 1, 6)
  313. customers := dieSix div (0.25 / lemonadePrice)
  314. loop
  315. cls
  316. customers := customers - 1
  317. money := money + lemonadePrice
  318. cups := cups - 1
  319. lemons := lemons - 1
  320. sugar := sugar - 1
  321. delay (250)
  322. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  323. exit when customers = 0
  324. end loop
  325. elsif weather = 6 then
  326. put "Today will be ", (averageTemp + 2), " degrees and broken clouds."
  327. randint (dieSix, 1, 6)
  328. customers := dieSix div (0.15 / lemonadePrice)
  329. loop
  330. cls
  331. customers := customers - 1
  332. money := money + lemonadePrice
  333. cups := cups - 1
  334. lemons := lemons - 1
  335. sugar := sugar - 1
  336. delay (250)
  337. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  338. exit when customers = 0
  339. end loop
  340. elsif weather = 7 then
  341. put "Today will be ", averageTemp, " degrees and clear skies."
  342. randint (dieSix, 1, 6)
  343. customers := dieSix div (0.25 / lemonadePrice)
  344. loop
  345. cls
  346. customers := customers - 1
  347. money := money + lemonadePrice
  348. cups := cups - 1
  349. lemons := lemons - 1
  350. sugar := sugar - 1
  351. delay (250)
  352. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  353. exit when customers = 0
  354. end loop
  355. elsif weather = 8 then
  356. put "Today will be ", (averageTemp - 3), " degrees and clear skies."
  357. randint (dieSix, 1, 6)
  358. customers := dieSix div (0.39 / lemonadePrice)
  359. loop
  360. cls
  361. customers := customers - 1
  362. money := money + lemonadePrice
  363. cups := cups - 1
  364. lemons := lemons - 1
  365. sugar := sugar - 1
  366. delay (250)
  367. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  368. exit when customers = 0
  369. end loop
  370. elsif weather = 9 then
  371. put "Today will be ", (averageTemp + 3), " degrees and occasional clouds."
  372. randint (dieSix, 1, 6)
  373. customers := dieSix div (0.11 / lemonadePrice)
  374. loop
  375. cls
  376. customers := customers - 1
  377. money := money + lemonadePrice
  378. cups := cups - 1
  379. lemons := lemons - 1
  380. sugar := sugar - 1
  381. delay (250)
  382. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  383. exit when customers = 0
  384. end loop
  385. elsif weather = 10 then
  386. put "Today will be ", (averageTemp - 4), " degrees and broken clouds."
  387. randint (dieSix, 1, 6)
  388. customers := dieSix div (0.41 / lemonadePrice)
  389. loop
  390. cls
  391. customers := customers - 1
  392. money := money + lemonadePrice
  393. cups := cups - 1
  394. lemons := lemons - 1
  395. sugar := sugar - 1
  396. delay (250)
  397. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  398. exit when customers = 0
  399. end loop
  400. elsif weather = 11 then
  401. put "Today will be ", (averageTemp + 7), " degrees, a bright sun, and humid air."
  402. randint (dieSix, 1, 6)
  403. customers := dieSix div (0.06 / lemonadePrice)
  404. loop
  405. cls
  406. customers := customers - 1
  407. money := money + lemonadePrice
  408. cups := cups - 1
  409. lemons := lemons - 1
  410. sugar := sugar - 1
  411. delay (250)
  412. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  413. exit when customers = 0
  414. end loop
  415. elsif weather = 12 then
  416. put "Today will be ", (averageTemp + 4), " degrees and clear skies."
  417. randint (dieSix, 1, 6)
  418. customers := dieSix div (0.09 / lemonadePrice)
  419. loop
  420. cls
  421. customers := customers - 1
  422. money := money + lemonadePrice
  423. cups := cups - 1
  424. lemons := lemons - 1
  425. sugar := sugar - 1
  426. delay (250)
  427. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  428. exit when customers = 0
  429. end loop
  430. elsif weather = 13 then
  431. put "Today will be ", averageTemp, " degrees and clear skies."
  432. randint (dieSix, 1, 6)
  433. customers := dieSix div (0.25 / lemonadePrice)
  434. loop
  435. cls
  436. customers := customers - 1
  437. money := money + lemonadePrice
  438. cups := cups - 1
  439. lemons := lemons - 1
  440. sugar := sugar - 1
  441. delay (250)
  442. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  443. exit when customers = 0
  444. end loop
  445. elsif weather = 14 then
  446. put "Today will be ", (averageTemp - 3), " degrees and rain."
  447. randint (dieSix, 1, 6)
  448. customers := dieSix div (0.39 / lemonadePrice)
  449. loop
  450. cls
  451. customers := customers - 1
  452. money := money + lemonadePrice
  453. cups := cups - 1
  454. lemons := lemons - 1
  455. sugar := sugar - 1
  456. delay (250)
  457. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  458. exit when customers = 0
  459. end loop
  460. elsif weather = 15 then
  461. put "Today will be ", (averageTemp + 3), " degrees and heavy clouds."
  462. randint (dieSix, 1, 6)
  463. customers := dieSix div (0.11 / lemonadePrice)
  464. loop
  465. cls
  466. customers := customers - 1
  467. money := money + lemonadePrice
  468. cups := cups - 1
  469. lemons := lemons - 1
  470. sugar := sugar - 1
  471. delay (250)
  472. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  473. exit when customers = 0
  474. end loop
  475. elsif weather = 16 then
  476. put "Today will be ", (averageTemp - 2), " degrees and broken clouds."
  477. randint (dieSix, 1, 6)
  478. customers := dieSix div (0.35 / lemonadePrice)
  479. loop
  480. cls
  481. customers := customers - 1
  482. money := money + lemonadePrice
  483. cups := cups - 1
  484. lemons := lemons - 1
  485. sugar := sugar - 1
  486. delay (250)
  487. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  488. exit when customers = 0
  489. end loop
  490. elsif weather = 17 then
  491. put "Today will be ", averageTemp, " degrees and clear skies."
  492. randint (dieSix, 1, 6)
  493. customers := dieSix div (0.25 / lemonadePrice)
  494. loop
  495. cls
  496. customers := customers - 1
  497. money := money + lemonadePrice
  498. cups := cups - 1
  499. lemons := lemons - 1
  500. sugar := sugar - 1
  501. delay (250)
  502. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  503. exit when customers = 0
  504. end loop
  505. elsif weather = 18 then
  506. put "Today will be ", (averageTemp + 2), " degrees and clear skies."
  507. randint (dieSix, 1, 6)
  508. customers := dieSix div (0.15 / lemonadePrice)
  509. loop
  510. cls
  511. customers := customers - 1
  512. money := money + lemonadePrice
  513. cups := cups - 1
  514. lemons := lemons - 1
  515. sugar := sugar - 1
  516. exit when customers = 0
  517. delay (250)
  518. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  519. end loop
  520. elsif weather = 19 then
  521. put "Today will be ", averageTemp, " degrees and clear skies."
  522. randint (dieSix, 1, 6)
  523. customers := dieSix div (0.25 / lemonadePrice)
  524. loop
  525. cls
  526. customers := customers - 1
  527. money := money + lemonadePrice
  528. cups := cups - 1
  529. lemons := lemons - 1
  530. sugar := sugar - 1
  531. delay (250)
  532. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  533. exit when customers = 0
  534. end loop
  535. elsif weather = 20 then
  536. put "Today will be ", (averageTemp - 1), " degrees and cloudy."
  537. randint (dieSix, 1, 6)
  538. customers := dieSix div (0.30 / lemonadePrice)
  539. loop
  540. cls
  541. customers := customers - 1
  542. money := money + lemonadePrice
  543. cups := cups - 1
  544. lemons := lemons - 1
  545. sugar := sugar - 1
  546. delay (250)
  547. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  548. exit when customers = 0
  549. end loop
  550. elsif weather = 21 then
  551. put "Today will be ", (averageTemp + 1), " degrees and rainy weather."
  552. randint (dieSix, 1, 6)
  553. customers := dieSix div (0.20 / lemonadePrice)
  554. loop
  555. cls
  556. customers := customers - 1
  557. money := money + lemonadePrice
  558. cups := cups - 1
  559. lemons := lemons - 1
  560. sugar := sugar - 1
  561. delay (250)
  562. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  563. exit when customers = 0
  564. end loop
  565. elsif weather = 22 then
  566. put "Today will be ", (averageTemp + 7), " degrees, a bright sun, and humid air."
  567. randint (dieSix, 1, 6)
  568. customers := dieSix div (0.06 / lemonadePrice)
  569. loop
  570. cls
  571. customers := customers - 1
  572. money := money + lemonadePrice
  573. cups := cups - 1
  574. lemons := lemons - 1
  575. sugar := sugar - 1
  576. delay (250)
  577. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  578. exit when customers = 0
  579. end loop
  580. elsif weather = 23 then
  581. put "Today will be ", averageTemp, " degrees and clear skies."
  582. randint (dieSix, 1, 6)
  583. customers := dieSix div (0.25 / lemonadePrice)
  584. loop
  585. cls
  586. customers := customers - 1
  587. money := money + lemonadePrice
  588. cups := cups - 1
  589. lemons := lemons - 1
  590. sugar := sugar - 1
  591. delay (250)
  592. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  593. exit when customers = 0
  594. end loop
  595. elsif weather = 24 then
  596. put "Today will be ", (averageTemp + 3), " degrees."
  597. randint (dieSix, 1, 6)
  598. customers := dieSix div (0.15 / lemonadePrice)
  599. loop
  600. cls
  601. customers := customers - 1
  602. money := money + lemonadePrice
  603. cups := cups - 1
  604. lemons := lemons - 1
  605. sugar := sugar - 1
  606. delay (250)
  607. put "Money = ", money, "; cups = ", cups, "; sugar = ", sugar, "; lemons = ", lemons, "."
  608. exit when customers = 0
  609. end loop
  610. elsif weather = 25 then
  611. cls
  612. put "Today, a tornado struck. You lost the stand and all your supplies."
  613. put " _______ _______ __ __ _______ "
  614. put "| _____| | ___ | | \/ | | _____|"
  615. put "| | ___ | |___| | | |\ /| | | |___ "
  616. put "| | |__ | | ___ | | | \/ | | | ___| "
  617. put "| |___| | | | | | | | | | | |_____ "
  618. put "|_______| |_| |_| |_| |_| |_______|"
  619. put " _______ _ _ _______ _______ "
  620. put "| ___ | | | | | | _____| | ___ | "
  621. put "| | | | | | | | | |___ | |___| | "
  622. put "| | | | | | | | | ___| | ___ | "
  623. put "| |___| | | |_| | | |_____ | | | | "
  624. put "|_______| |___| |_______| |_| |_|"
  625. days := 30
  626. didWeWin := "n"
  627. else
  628. put "An error occurred. Please reload this run window."
  629. end if
  630.  
  631. if days = 30 then
  632. if didWeWin = "y" then
  633. put "Congratulations! You won!"
  634. elsif didWeWin = "n" then
  635. put "You lost."
  636. else
  637. if money = 0 then
  638. put "You went broke."
  639. else
  640. put "You finished day 30 with ", money, " dollars."
  641. end if
  642. end if
  643. else
  644. put "Another day dawns on the lemonade stand."
  645. end if
  646. exit when days = 30
  647. end loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement