Skip to content

KiShiVi/Tic-Tac-Toe-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tic-Tac-Toe-Python

Game

Game

Description

Comic project - tic-tac-toe, written in python.

Allows you to play a game of tic-tac-toe with a real opponent on the same host.

The players themselves determine the size of the field and the number of cells for winning.

API

TicTacToe constructor

TicTacToe(a, b, player1, player2, countOfCellForWin) - constructor for creating a TicTacToe object

a :Int - field width (1..26)

b :Int - field height (1..26)

player1 :Player - first player

player2 :Player - second player

countOfCellForWin :Int - number of cells to win (Default: 3)

Player constructor

Player(name) - constructor for creating a Player object

name :String - player name

API for the game

TicTacToeObj.game() - launches the game

Code Run Examples

from tic_tac_toe import Player
from tic_tac_toe import TicTacToe

# Launch of the classic 3x3 TicTacToe
gameObj = TicTacToe(3, 3, Player('Ivan'), Player('Alex'), 3) 
gameObj.game()

Notes

  • The program does not use third-party libraries
  • A console game

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages