mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-04-18 23:41:17 -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
|
@ -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>
|
|
@ -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
Reference in a new issue