feat: boiler plate html added

This commit is contained in:
Smigz 2023-11-27 07:01:11 -05:00
parent 2cc0e9d514
commit 52e8b3c0b3
2 changed files with 28 additions and 9 deletions

View file

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tic-Tac-Toe</title>
</head>
<body>
<div class="container">
<header>
<div class="header"></div>
</header>
<main>
<div class="content">
<div class="game-area">
</div>
</div>
</main>
<footer>
<div class="footer"></div>
</footer>
</div>
</body>
</html>

View file

@ -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