Advertisement
IBeetle

mouse

Jan 7th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.52 KB | None | 0 0
  1. var x, y, bnum, updown, font, font2, font3, font4, font5, font6, countras, countap, countmel, countgrap, countorg, countap2, loopcount : int
  2. countras := 0
  3. countap := 0
  4. countmel := 0
  5. countgrap := 0
  6. countorg := 0
  7. countap2 := 0
  8. loopcount := 0
  9. font := Font.New ("Arial Black:20:bold")
  10. font2 := Font.New ("Arial Black:20:bold")
  11. font3 := Font.New ("Arial Black:20:bold")
  12. font4 := Font.New ("Arial Black:20:bold")
  13. font5 := Font.New ("Arial Black:20:bold")
  14. font6 := Font.New ("Arial Black:20:bold")
  15. assert font > 0
  16. loop
  17. loopcount := loopcount + 1
  18. locate (2, 30)
  19. put "Choose your favourite Jolly Rancher flavour"
  20. drawfillbox (0, 0, 200, 200, 9)
  21. drawfillbox (200, 0, 400, 200, 10)
  22. drawfillbox (400, 0, 1000, 200, 12)
  23. Font.Draw ("Blue Ras.", 18, 85, font, black)
  24. Font.Draw ("Green Apple", 210, 80, font2, black)
  25. Font.Draw ("Watermellon", 430, 80, font3, black)
  26. loop
  27. buttonwait ("down", x, y, bnum, updown)
  28. locate (5, 1)
  29. put " "
  30. if ((x >= 0 and x <= 200) and (y >= 0 and y <= 200)) then
  31. put "Blue Rasberry"
  32. countras := countras + 1
  33. exit
  34. elsif ((x >= 201 and x <= 400) and (y >= 0 and y <= 200)) then
  35. put "Green Apple"
  36. countap := countap + 1
  37. exit
  38. elsif ((x >= 401 and x <= 640) and (y >= 0 and y <= 200)) then
  39. put "Watermellon"
  40. countmel := countmel + 1
  41. exit
  42. else
  43. locate (5, 1)
  44. put "wrong selection"
  45. end if
  46. end loop
  47. cls
  48. locate (2, 30)
  49. put "Choose your favourite Juice"
  50. drawfillbox (0, 0, 200, 200, 5)
  51. drawfillbox (200, 0, 400, 200, 42)
  52. drawfillbox (400, 0, 1000, 200, 12)
  53. Font.Draw ("Grape", 18, 85, font4, black)
  54. Font.Draw ("Orange", 210, 80, font5, black)
  55. Font.Draw ("Apple", 430, 80, font6, black)
  56. loop
  57. buttonwait ("down", x, y, bnum, updown)
  58. locate (5, 1)
  59. put " "
  60. if ((x >= 0 and x <= 200) and (y >= 0 and y <= 200)) then
  61. put "Grape"
  62. countgrap := countgrap + 1
  63. exit
  64. elsif ((x >= 201 and x <= 400) and (y >= 0 and y <= 200)) then
  65. put "Orange"
  66. countorg := countorg + 1
  67. exit
  68. elsif ((x >= 401 and x <= 640) and (y >= 0 and y <= 200)) then
  69. put "Apple"
  70. countap2 := countap2 + 1
  71. exit
  72. else
  73. locate (5, 1)
  74. put "wrong selection"
  75. end if
  76. end loop
  77. cls
  78. locate (1, 1)
  79.  
  80. put "Press anywhere to take survey again"
  81. put "Press red to exit survey and go to statistics for this trial"
  82. drawfillbox (200, 0, 400, 200, 12)
  83. buttonwait ("down", x, y, bnum, updown)
  84. if ((x >= 201 and x <= 400) and (y >= 0 and y <= 200)) then
  85. exit
  86. else
  87. locate (1, 1)
  88. put " "
  89. put " "
  90. end if
  91. end loop
  92. cls
  93. locate (2, 30)
  94. put "Statistics"
  95. put " "
  96. put " "
  97. put "Number of people/times the survey was taken:", " ", loopcount
  98. put "Number of times each option was chosen in the ENTIRE trial..."
  99. put "Jolly Rancher flavor: Blue Rasberry -", " ", countras
  100. put "Jolly Rancher flavor: Green Apple -", " ", countap
  101. put "Jolly Rancher flavor: Watermellon -", " ", countmel
  102. put "Juice flavor : Grape -", " ", countgrap
  103. put "Juice flavor : Orange - ", " ", countorg
  104. put "Juice flavor : Apple - ", " ", countap2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement