Advertisement
Guest User

Untitled

a guest
Jul 1st, 2013
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var Symbols = []; // list of symbols on the machine
  2. var slots = []; // each slot contains the index of the symbol it contains
  3. var NUMSLOTS = 15;
  4. var NUMSYMBOLS = 5;
  5. var FLICKERDURATION = 3000; //Milliseconds
  6.  
  7. function randomize(){
  8.     var i = 0;
  9.     for(i; i < NUMSLOTS; i++){
  10.         // picks a random symbol from the symbols list and stores it in the slot
  11.         slots[i] = Math.floor(Math.random()*NUMSYMBOLS);
  12.     }
  13. }
  14.  
  15. function buttonClick(){
  16.     randomize(); //figure out what all the slots will change into
  17.     setInterval(flickerSlots(), 20); //show symbols flickering before showing the result
  18.     setTimeout(FLICKERDURATION, showResult()); //show the actual resulting symbols
  19. }
  20.  
  21. function flickerSlots(){
  22.    
  23. }
  24.  
  25. function showResult(){
  26.     clearInterval(); //stop the flickering
  27. }
  28.  
  29. window.onload = function(){
  30.     randomize(); // sets all your slots to an initial value before the lever is started
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement