maooyer / tic-tac-toe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tic Tac Toe

Tic Tac Toe

This is a simple Tic Tac Toe game, which based on React Official Tutorial. It's written in TypeScript and include all the extend tasks mentioned in the end of tutorial.

Usage

  1. fork this repository and cd into it
  2. pnpm install
  3. pnpm run dev

Extend Tasks

  • For the current move only, show “You are at move #…” instead of a button.
  • Rewrite Board to use two loops to make the squares instead of hardcoding them.
  • Add a toggle button that lets you sort the moves in either ascending or descending order.
  • When someone wins, highlight the three squares that caused the win (and when no one wins, display a message about the result being a draw).
  • Display the location for each move in the format (row, col) in the move history list.

About


Languages

Language:TypeScript 69.6%Language:CSS 17.6%Language:JavaScript 7.0%Language:HTML 5.9%