Instructions for Creating a Game of Tic-Tac-Toe

click here to view an example of this game

  1. Download the tic_tac_toe.zip file
  2. Open the questions.js file using a text editor like WordPad
  3. You will need to type in the following information:

    The letter which corresponds to the correct option
    The extra feedback you want your students to receive when they do not answer correctly. This is the feedback that comes after the phrase: Sorry, that's not right. The correct answer was:
    The question
    The four possible options. These will correspond to options a, b, c and d.

Here is an example:

new question("c", "The plane TOOK OFF on time but landed twenty minutes late.", "The plane LEFT on time but landed twenty minutes late.", "took up", "went up", "took off", "went off"),

Each of these elements should be written within quotation marks and separated by commas. If you use and apostrophe, it should be preceded by a backslash, for example It\'s five o\'clock.

The entire question should be on ONE line and there should be a comma at the end of each of the questions except the last.

You can add as many questions as you like. The program will select a question at random each time the students click on one of the squares.

Save the file in text format. If this adds the extension .txt to your document, you will need to change it to .js. If you change the name to something other than questions.js, you will have to edit the following line at the top of the tic_tac_toe.htm page:

<SCRIPT LANGUAGE="JavaScript1.1" SRC="questions.js" ></SCRIPT>

If you would like to translate the game into a different language or change the text in the instructions and/or pop-up messages, you will need to edit the corresponding variables. To make this easier to do, I have put all the editable variables together at the top of the tic_tac_toe.htm page. To see the source code, open the page with a text editor like WordPad or click on HTML (FrontPage) or View/Code (Dreamweaver).

If you decide to post this activity, remember that you will need to upload all the necessary files. The three images and the questions.js file should be in the same folder as the tic_tac_toe.htm page.

If you would like to have 3 options instead of 4, download this zip file with an alternative version of the picture_puzzle.html and questions.js files. 

If you have any problems using this script, you can contact me at birgit@cybernetic-meadows.net. Please send the URL of the page that is not working properly.

If you would like to share the activities you have created with other teachers, please send me an email with the URL of your activity and I will link to them from this site.

The same questions.js file can be used to create a game of Picture Puzzle (for 1 player) or a game of Snakes and Ladders (for 1-4 players).