Advertisement
Guest User

Untitled

a guest
Nov 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function initializeBoard(highestNumber){
  3.   let tmpBoard = [[], [], []];
  4.   for(let i = 1; i <= highestNumber; i++){
  5.     tmpBoard[0].push(i);
  6.     tmpBoard[1].push(0);
  7.     tmpBoard[2].push(0);
  8.   }
  9.   return tmpBoard;
  10. }
  11.  
  12. function printBoard(board, highestNumber){
  13.   for(let i = 0; i <= highestNumber; i++){
  14.     console.log(`${board[0][i]} | ${board[1][i]} | ${board[2][i]}`);
  15.   }
  16. }
  17.  
  18. function moveBlocks(index, start, end, temp){
  19.   moveBlocks(index - 1, start, temp, end);
  20.  
  21.  
  22. }
  23.  
  24. let highestNumber = 3;
  25. let board = initializeBoard(highestNumber);
  26. printBoard(board, highestNumber);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement