본문 바로가기

React

[React] Tic-Tae-Toe game

React 공부를 처음 시작하면서, 

대부분 책보단 react.dev에서 공부하기를 추천하기에 react.dev로 처음 react를 접했다.

 

처음엔 Quick Start로 기본적인 것을 훑어보고,

Tic-Tae-Toe 게임을 만들면서 React를 본격적으로 시작하였다!! 

 

"" 동작 구조 및 설명 작성 예정 ""

 

해당 코드는 Github에 올려놨다!

주석으로 각각의 내용도 정리해놨으니 참고하실 바란다!

https://github.com/imyunhee/react/tree/main/tictaetoe

 

react/tictaetoe at main · imyunhee/react

Contribute to imyunhee/react development by creating an account on GitHub.

github.com

 

Extra Practice

  1. For the current move only, show “You are at move #…” instead of a button.
  2. Rewrite Board to use two loops to make the squares instead of hardcoding them.
  3. Add a toggle button that lets you sort the moves in either ascending or descending order.
  4. 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).
  5. Display the location for each move in the format (row, col) in the move history list.