Advertisement
pickleball9

Untitled

Jan 21st, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1.  
  2. onEvent("startBtn", "click", function( ) {
  3. hideElement("greaterLabel");
  4. hideElement("lessThanLabel");
  5. setScreen("intakeScreen");
  6. setNumber("tdInput", 0);
  7. setNumber("extraPointInput", 0);
  8. setNumber("twoPointConInput", 0);
  9. setNumber("fieldgoalInput", 0);
  10. setNumber("pickSixInput", 0);
  11. });
  12. onEvent("nextButton", "click", function( ) {
  13. getTotal();
  14. setScreen("pointTotalScreen");
  15. });
  16. onEvent("next2Button", "click", function( ) {
  17. setScreen("averageScreen");
  18. });
  19. onEvent("nextupButton", "click", function( ) {
  20. setScreen("teamScreen");
  21. });
  22. onEvent("goHome", "click", function( ) {
  23. setScreen("homeScreen");
  24. });
  25.  
  26.  
  27. function getTotal() {
  28. var td = getNumber("tdInput");
  29. var exP = getNumber("extraPointInput");
  30. var twoP = getNumber("twoPointConInput");
  31. var fGoal = getNumber("fieldgoalInput");
  32. var pSix = getNumber("pickSixInput");
  33. var total = (td * 6) + (exP * 1) + (twoP * 2) + (fGoal * 3) + (pSix * 6);
  34. setNumber("pointCount", total);
  35. scoreAverage(total);
  36. nflAverage(total);
  37. }
  38.  
  39. function scoreAverage(total) {
  40. if (total > 24) {
  41. showElement("greaterLabel");
  42. hideElement("lessThanLabel");
  43. hideElement("equalLabel");
  44. } else {
  45. showElement("lessThanLabel");
  46. hideElement("greaterLabel");
  47. hideElement("equalLabel");
  48. }
  49. if (total == 24) {
  50. showElement("equalLabel");
  51. hideElement("greaterLabel");
  52. hideElement("lessThanLabel");
  53. }
  54. }
  55.  
  56. function nflAverage(total) {
  57. if (total >= 34) {
  58. setText("teamScreenLabel", "Your team scores more points or is equal to what the Baltimore Ravens score per game");
  59. showElement("ravens");
  60. showElement("ravensPoints");
  61. hideElement("colts");
  62. hideElement("coltsPoints");
  63. hideElement("raiders");
  64. hideElement("raidersPoints");
  65. hideElement("redskins");
  66. hideElement("redskinsPoints");
  67. } else if (total >= 23) {
  68. setText("teamScreenLabel", "Your team scores more points or is equal to what the Indianapolis Colts score per game");
  69. showElement("colts");
  70. showElement("coltsPoints");
  71. hideElement("ravens");
  72. hideElement("ravensPoints");
  73. hideElement("raiders");
  74. hideElement("raidersPoints");
  75. hideElement("redskins");
  76. hideElement("redskinsPoints");
  77. } else if (total >= 20) {
  78. setText("teamScreenLabel", "Your team scores more points or is equal to what the Oakland Raiders score per game");
  79. showElement("raiders");
  80. showElement("raidersPoints");
  81. hideElement("ravens");
  82. hideElement("ravensPoints");
  83. hideElement("redskins");
  84. hideElement("redskinsPoints");
  85. hideElement("colts");
  86. hideElement("coltsPoints");
  87. } else if (total >= 17) {
  88. setText("teamScreenLabel", "Your team scores more points or is equal to what the Washington Redskins score per game");
  89. showElement("redskins");
  90. showElement("redskinsPoints");
  91. hideElement("raiders");
  92. hideElement("raidersPoints");
  93. hideElement("ravens");
  94. hideElement("ravensPoints");
  95. hideElement("colts");
  96. hideElement("coltsPoints");
  97. } else {
  98. setText("teamScreenLabel", "You score less than the Redskins per game. This is the lowest average points per game in the NFL");
  99. showElement("redskins");
  100. showElement("redskinsPoints");
  101. hideElement("raiders");
  102. hideElement("raidersPoints");
  103. hideElement("ravens");
  104. hideElement("ravensPoints");
  105. hideElement("colts");
  106. hideElement("coltsPoints");
  107. }
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement