Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. //==================//
  2. // Part 1 //
  3. //==================//
  4.  
  5. var userBalance = 0;
  6. var incrementingScore = 0;
  7. var scoreDifference = 0;
  8.  
  9. // Gets called whenever the money finished tweening to the bottom.
  10. function addFromCatch(value)
  11. {
  12. scoreDifference = 0;
  13. userBalance += value;
  14. scoreDifference = userBalance - incrementingScore;
  15. }
  16.  
  17. // Gets called every frame.
  18. // Time elapsed since the last update is passed into the function(milliseconds)
  19. function onUpdate({delta})
  20. {
  21.  
  22. if (userBalance > incrementingScore)
  23. {
  24.  
  25. incrementingScore += scoreDifference;
  26. }
  27.  
  28.  
  29. updateBalance(incrementingScore);
  30. }
  31.  
  32. // You have access to a function updateBalance which
  33. // takes in a string and sets the ui to that value
  34. // updateBalance("1");
  35.  
  36.  
  37. //==================//
  38. // Part 2 //
  39. //==================//
  40.  
  41. function processSlots(input)
  42. {
  43. console.log("Output: ");
  44. };
  45.  
  46. // examples input
  47. var array = [
  48. [1,0,0,0,1],
  49. [0,1,0,1,0],
  50. [0,0,1,0,0]
  51. ];
  52. //Output: '1 winning line, scoring 20 points.'
  53.  
  54. var array2 = [
  55. [2,4,2,2,3],
  56. [1,1,1,4,1],
  57. [3,3,3,4,2]
  58. ];
  59. //Output: '2 winning lines, scoring a total 30 points.'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement