//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f. pragma solidity ^0.4.18; contract TicTacToe { enum CellState { Clear, Owner, Player } enum NextMove { Owner, Player } struct Game { address owner; address player; NextMove nextMove; CellState[3][3] state; } uint256 private nextGameId = 0; mapping(uint256 => Game) private games; function createGame() public returns (uint256 gameId) { Game memory game; game.owner = msg.sender; gameId = nextGameId; nextGameId++; games[gameId] = game; } function acceptInvite(uint256 gameId) public returns (NextMove nextMove) { game = games[gameId]; games[gameId] = game; nextMove = NextMove.Owner; } }
0.4.18