mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-06-28 04:45: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
|
@ -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() {
|
const game = (function() {
|
||||||
//settings
|
|
||||||
|
|
||||||
|
|
||||||
// only needed for CLI game
|
// only needed for CLI game
|
||||||
const readline = require("readline");
|
const readline = require("readline");
|
||||||
const rl = readline.createInterface({
|
const rl = readline.createInterface({
|
||||||
|
@ -32,20 +29,17 @@ const game = (function() {
|
||||||
placeOnBoard(position, piece);
|
placeOnBoard(position, piece);
|
||||||
printGameBoard();
|
printGameBoard();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const playGame = async function(){
|
const playGame = async function(){
|
||||||
for(let i = 0; i<9; i++) {
|
for(let i = 0; i<9; i++) {
|
||||||
const move = await askQuestion();
|
const move = await askQuestion();
|
||||||
if (i % 2 === 0) {
|
if (i % 2 === 0) {
|
||||||
|
|
||||||
handleAskQuestion(move, 'o');
|
|
||||||
} else {
|
|
||||||
handleAskQuestion(move, 'x');
|
handleAskQuestion(move, 'x');
|
||||||
|
} else {
|
||||||
|
handleAskQuestion(move, 'o');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i > 1) {
|
if (i > 3) {
|
||||||
let results = evalGameOutcome(gameBoard);
|
let results = evalGameOutcome(gameBoard);
|
||||||
console.log(results + ' game over');
|
console.log(results + ' game over');
|
||||||
if (results) return
|
if (results) return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue