Closed mdewey closed 6 years ago
Requirements Create a structure of page on Moqup Create the grid Create the data structure for the grid Make each element in grid player's initials Create the data structure for the winning combinations Create the players Create the player name text boxes Create the player name buttons Players can only do one action per turn Determine winner Loop through winningCombonations and see if the players positions include a winning combo Create scores Create score labels Create variables called playerOneScore and playerTwoScore Increment score if they win If score reaches 5, they are the ultimate winner Display winner Create a winner label If player wins, push their name to the DOM Create play again functionality Create the play again button Clear the player's positions Clear the DOM's grid Make initials for the grid boxes.
playerOnePositions = [4, 3] playerTwoPositions = [8] Grid = [[1, 2, 3], [4, 5, 6], [7 , 8, 9]] winningCombos = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [1, 4, 7]...]
if (playerOnePositions > 2 || playerTwoPositions > 2) { for (let i = 0; i < winningCombos.length; i++) { if (playerOnePositions.includes(winningComobos[i][0] && playerOnePositions.includes(winningComboes[i][1] && playerOnePositions.includes(winningComboes[i][2] &&) { console.log("you won") } } }
Classes: Player Grid PlayMarks Game AddToDOM Variables: playerOnePositions playerOneScore playerOneName playerTwoPositions playerTwoScore playerTwoName winningComboes gridStructure
title: Designing Tic-Tac-Toe draft: true
With a partner, create a design for a tic-tac-toe game. Do not worry about writing code; rather, practice your technical design skills (i.e. thinking about how you would code this).
Objectives
Requirements
Features to consider:
X
andO
.X
orO
, respective of the turn.TIPS:
Explorer Mode
Submit a full design of how to approach this problem. This should include:
Adventure Mode
or
Epic Mode
Additional Resources