Tic Tac Toe Lab Exercise Intro

Introduction

In this lab, you will build a Tic-Tac-Toe game incorporating the web technologies and techniques you’ve worked with thus far:

Minimum requirements

Items of note

Think about the below ideas as you’re building this lab. Decisions have been made for you in the pseudocode that you should pay attention to because they’re important notes for your future work:

Pseudocode

Pseudocode is a detailed description of what an application must do, written in natural language instead of a particular programming language.

Well-written pseudocode should be easily translated into actual code. The best way to get started is to start with the big picture of what the app needs to do:

//1) Define the required variables used to track the state of the game.

//2) Store cached element references.

//3) Upon loading, the game state should be initialized, and a function should 
//   be called to render this game state.

//4) The state of the game should be rendered to the user.

//5) Define the required constants.

//6) Handle a player clicking a square with a `handleClick` function.

//7) Create Reset functionality.

Most web apps are event-driven by nature. Coding an event-driven program generally requires setting up the application when it loads (steps 1 - 5) and waiting for the user to interact with the app (steps 6 & 7).

Next, we can start expanding on these steps with detailed pseudocode.

The remainder of this exercise walks through those steps. Follow along from start to finish, and you’ll have a complete game of Tic-Tac-Toe that meets the minimum requirements!