diff --git a/src/backend/components/boardgame.tsx b/src/backend/components/boardgame.tsx index ca46281..ef237c3 100644 --- a/src/backend/components/boardgame.tsx +++ b/src/backend/components/boardgame.tsx @@ -3,6 +3,7 @@ import { BoardgameStateType, CurrentOutcome, GameRules, + Player, SquareState, formatSquareState, } from "../../shared/datatypes.ts"; @@ -17,6 +18,12 @@ const getClassAndDisplayAttributes = ( style: getDisplayStates(gameState, currentOutcome)[className] ? {} : { display: "none" }, }); +const getSubmitAttributes = (key: string, targetState: BoardgameStateType) => ({ + type: "submit" as const, + name: key, + value: targetState.serialize(), +}); + const getCellHtml = ({ key, gameState, @@ -32,7 +39,7 @@ const getCellHtml = ({ }) => { if (!gameState.board) { return ( - ); @@ -44,7 +51,7 @@ const getCellHtml = ({ ? gameState.withMove(row, column) : gameState; return ( - ); @@ -76,6 +83,34 @@ export const getBoardgameHtml = (key: string, gameState: BoardgameStateType, rul Draw

+

+ Currently X moves are made manually.{" "} + +

+ +

+ Currently X moves are made by computer.{" "} + +

+ +

+ Currently O moves are made manually.{" "} + +

+ +

+ Currently O moves are made by computer.{" "} + +

+