mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-06-28 21:05:36 -04:00
feat: boiler plate html added
This commit is contained in:
parent
2cc0e9d514
commit
52e8b3c0b3
2 changed files with 28 additions and 9 deletions
|
@ -1,7 +1,4 @@
|
|||
const game = (function() {
|
||||
//settings
|
||||
|
||||
|
||||
// only needed for CLI game
|
||||
const readline = require("readline");
|
||||
const rl = readline.createInterface({
|
||||
|
@ -32,20 +29,17 @@ const game = (function() {
|
|||
placeOnBoard(position, piece);
|
||||
printGameBoard();
|
||||
}
|
||||
|
||||
|
||||
|
||||
const playGame = async function(){
|
||||
for(let i = 0; i<9; i++) {
|
||||
const move = await askQuestion();
|
||||
if (i % 2 === 0) {
|
||||
|
||||
handleAskQuestion(move, 'o');
|
||||
} else {
|
||||
handleAskQuestion(move, 'x');
|
||||
} else {
|
||||
handleAskQuestion(move, 'o');
|
||||
}
|
||||
|
||||
if (i > 1) {
|
||||
if (i > 3) {
|
||||
let results = evalGameOutcome(gameBoard);
|
||||
console.log(results + ' game over');
|
||||
if (results) return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue