Problem 2. tttCheckMove()
Write a function named tttCheckMove() that checks whether or not a TicTacMove is on an empty space
on a TTT board.
Input (two parameters):
· Parameter 1: A string of 9 characters denoting the state of a TTT board. Each character in the
string indicates the state of one TicTacToe square – an ‘X’ or ‘O’ if the square is occupied, a ‘-‘
if it is not. The squares are numbered left to right and from the bottom up:

|6|7|8|
|3|4|5|
|0|1|2| ---- simulates tic tac toe board

For example, this TicTacToe board
| | | |
|X| | | ---- X is in space '3'
| | | |
is represented by the string '---X-----'.
· Parameter 2: An int from 0 to 8 inclusive, representing a TicTacToe move.
Output:
Return True if the move is in an unoccupied space, otherwise return False.
Here is sample output:

from ticTacToe import *
board = '----X----'
move = 1
tttCheckMove(board, move)
False
row = 0
column = 1
tttCheckMove(board, row, column)
True

Recommended Answers

All 2 Replies

You forgot your code and description of your problem.

I have no idea where to start

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.