

In the first part of the code (Figure 3), the game area was styled (colors, position, and size).Tic-Tac-Toe JavaScript game is a simple example of games you can program in JavaScript. In the CSS file, the background colors, space size and the "X" and "O" symbols were stipulated. The game frame uses id and class, previously informed in the HTML file (Figure 2). HTML file for the Tic Tac Toe interactive game. In addition, id and onclick command, are need within the JavaScript file to make the game interactive. , id and class are used for styling the elements within the CSS file. , containing header information and a button to start/restart the game The code was based on the work of Milne and CBFCursos. However, there are other ways to get an interactive Tic Tac Toe game. The first to complete horizontally or diagonally with the symbol that represents herself/himself wins the game.

The moves are alternate between player one and player two. The symbols "X" and "O" will be put between these lines. The game takes place on a board with four lines arranged horizontally and vertically (Figure 1). A player is represented by the symbol "X" and the other by a circle "O". Usually, two people can play the game at the same time.

The earliest reference to the Tic Tac Toe game dates from the excavations at the temple of Kurna (14th century BC) in Egypt.Īrchaeological explorations indicated that this game developed in different parts of the world, and there are some versions (number of rows and columns varies).Īlso, the game has different names depending on the region, for example, Tic Tac Toe (English-speaking countries) and Jogo da Velha (Brazil). JavaScript file development and Implementation

We have presented all code and you should follow this mini-project. In this article, we have demonstrated how to design Tic Tac Toe Game as a webpage using HTML, CSS and JavaScript.
