๐——๐—ฎ๐˜† ๐Ÿฎ๐Ÿฐ ๐—ผ๐—ณ ๐—Ÿ๐—ฒ๐—ฎ๐—ฟ๐—ป๐—ถ๐—ป๐—ด ๐— ๐—˜๐—ฅ๐—ก ๐—ฆ๐˜๐—ฎ๐—ฐ๐—ธ

I finished my DOM and Events lessons today. I spent my time building a project instead of watching videos.

I built a Tic-Tac-Toe game with vanilla JavaScript, HTML5, and CSS.

Writing code for a console is simple. Building logic for a user interface is different. It requires you to think about how a player interacts with the screen.

Here is how I built it:

To find a winner, I used an array of winning patterns. This covers all rows, columns, and diagonals:

[0, 1, 2], [3, 4, 5], [6, 7, 8] [0, 3, 6], [1, 4, 7], [2, 5, 8] [0, 4, 8], [2, 4, 6]

Building this helped me apply two weeks of lessons from Apna College. Practice makes the logic stick.

Source: https://dev.to/ali_hamza_589ec7b3eb6688d/day-24-of-learning-mern-stack-5eb3