Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {Board} from './board.js';
- class Game {
- constructor(numberOfRows, numberOfColumns, numberOfBombs){
- this._board = new Board (numberOfRows, numberOfColumns, numberOfBombs);
- }
- playMove(rowIndex, columnIndex){
- this._board.flipTile(rowIndex, columnIndex);
- if (this._board.playerBoard[rowIndex][columnIndex] === 'B') {
- console.log('GAME OVER!');
- this._board.print();
- } else if (this._board.hasSafeTiles()) {
- console.log('Current Board:');
- this._board.print();
- } else { console.log("YOU'VE WON THE GAME!");
- this._board.print();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment