Thumbnail

Tic Tac Toe

by Synthiam

A tic tac toe game that you can play with your robot.

Requires ARC v7 (Updated 9/14/2023) Source Code

How to add the Tic Tac Toe robot skill

  1. Load the most recent release of ARC (Get ARC).
  2. Press the Project tab from the top menu bar in ARC.
  3. Press Add Robot Skill from the button ribbon bar in ARC.
  4. Choose the Games category tab.
  5. Press the Tic Tac Toe icon to add the robot skill to your project.

Don't have a robot yet?

Follow the Getting Started Guide to build a robot and use the Tic Tac Toe robot skill.

How to use the Tic Tac Toe robot skill

This skill is a tic tac toe game that you can play with your robot. Configure script routines for many different options to add interesting behaviors as your robot kicks your butt at tic tac toexD There are even Cheat Sheet commands for additional control of the game board. For example, set up speech recognition to play with your voice!

Main Window

User-inserted image

1. Reset Game Button When pressed this will start a new game.

2. Robot Response Display This is where the robot will have a text based response.

3. Play Field Click where you would like to place your 'O'.

Configuration

User-inserted image

1. Turn Scripts This is where you can add unique personality scripts to the robot when it's the robot's turn or your turn.

2. Win scripts This is where you can add unique personality scripts to the robot when it wins or when you win.

3. Draw script This is where you can add unique personality scripts to the robot when the game ends in a draw.

How To Use the Tic Tac Toe

  1. Add a Tic Tac Toe skill to your ARC project (Project -> Add Skill -> Games -> Tic Tac Toe).

  2. Read the Robot Response Display instructions.

  3. Click where you would like to place your 'O' on the Play field.

  4. Play the Tic Tac Toe game until it's end.

  5. Click the Reset Game Button to start a new game.

Resources

Here is a project that DJ made that uses the Speech Recognition skill to play the Tic Tac Toe game: TicTacToe.ezb The source code for this skill is available here: TicTacToe.zip


ARC Pro

Upgrade to ARC Pro

With ARC Pro, your robot is not just a machine; it's your creative partner in the journey of technological exploration.

PRO
Australia
#1  

The code I write for the robot wins script is duplicated in the draw script. One should be able to have different scripts. Can this error be fixed?

PRO
Australia
#3  

That certainly fixed the script issue. I do find it freezes up occasionally when it's the robot's turn, particularly when using the middle position. Can't see any other pattern to cause it.

#4  

Can you provide more information to reproduce the "freezes up" scenario?

PRO
Australia
#5  

Freezing only occurs when it is the robot's turn - it says thinking, but fails to complete it's turn.  I just kept playing, using the middle square more often than the corners and it froze a few times.