Guest User

Untitled

a guest
Feb 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import {Board} from './board.js';
  2.  
  3. class Game {
  4. constructor(numberOfRows, numberOfColumns, numberOfBombs){
  5. this._board = new Board (numberOfRows, numberOfColumns, numberOfBombs);
  6. }
  7. playMove(rowIndex, columnIndex){
  8. this._board.flipTile(rowIndex, columnIndex);
  9.  
  10.  
  11. if (this._board.playerBoard[rowIndex][columnIndex] === 'B') {
  12. console.log('GAME OVER!');
  13. this._board.print();
  14. } else if (this._board.hasSafeTiles()) {
  15. console.log('Current Board:');
  16. this._board.print();
  17. } else { console.log("YOU'VE WON THE GAME!");
  18. this._board.print();
  19.  
  20. }
  21. }
  22.  
  23. }
  24. }
Add Comment
Please, Sign In to add comment