Package: ap-games
AP GamesThe AP Games is the result of the completion of the projectTic-Tac-Toe with AIatJetBrains Academy. This project
was developed just for fun and to learn Python and some
concepts of a decision-making algorithm.Tic-Tac-Toe with AI + bonusReversigameTic-tac-toe, is a paper-and-pencil game for two players,
X and O, who take turns marking the spaces in a 3×3 grid.
The player who succeeds in placing three of their marks in
a horizontal, vertical, or diagonal row is the winner.ReversiReversi is a strategy board game for two players who take
turns marking the spaces in an 8x8 board.Each player must place the piece so that an opponent's piece, or a
row of opponent's pieces, is flanked by your pieces. All of
the opponent's pieces between your pieces are then turned
over to become your color. The object of the game is to own
more pieces than your opponent when the game is over.
Seesource.The example below shows the game interface:Please choose the game:
	0 - Tic-Tac-Toe;
	1 - Reversi.
Print 'exit' to exit the program.

Input command: 1
Type 'start user1_type user2_type' to run the selected game,
where user_X_type is one of the supported values:
user, easy, hard and nightmare;
Type 'rules' to get game rules or type 'exit' to return
to the main menu.

Input command: rules
You must place the piece so that an opponent's piece, or a row
of opponent's pieces, is flanked by your pieces.
All of the opponent's pieces between your pieces are then
turned over to become your color. The object of the game is
to own more pieces than your opponent when the game is over.

Input command: start user hard
  -------------------
8 |                 |
7 |                 |
6 |                 |
5 |       X O       |
4 |       O X       |
3 |                 |
2 |                 |
1 |                 |
  -------------------
    1 2 3 4 5 6 7 8
Enter the coordinate [X]: 1 1
You cannot go here!
Enter the coordinate [X]: 1
You should enter two numbers!
Enter the coordinate [X]: 4 3
  -------------------
8 |                 |
7 |                 |
6 |                 |
5 |       X O       |
4 |       X X       |
3 |       X         |
2 |                 |
1 |                 |
  -------------------
    1 2 3 4 5 6 7 8
Making move level "hard" [O]
  -------------------
8 |                 |
7 |                 |
6 |                 |
5 |       X O       |
4 |       O X       |
3 |     O X         |
2 |                 |
1 |                 |
  -------------------
    1 2 3 4 5 6 7 8
Enter the coordinate [X]:InstallationThe project has been tested only withpython 3.8on
Ubuntu Linux and Windows 10. If you have python 3.8 and above
installed in your machine, just install the AP Games fromPyPI:python--version
pipinstallap-gamesYou can find source code of this package ongithub.
Seeaplatkouski/ap-gamesrepository.How to useRun module:python-map_games[game][user-1user-2]Where:gameis a value from the following set:0ortic-tac-toefor Tic-Tac-Toe game;1orreversifor Reversi game.user-1anduser-2are values from the following
set:userfor human player;easy,medium,hardandnightmarefor AI
player.Note: Parameters in brackets are optional.Or open the python console and type:# Python version 3.8+fromap_gamesimportclicli.main()NotesThis package can be run as a console game or integrated into
another application. This project provides the following basic
structures:SquareGameboardGameBaseTicTacToeReversiPlayerHumanPlayerAIPlayer- uses mini-max as decision-making algorithm.CreditsThanks to Gaurav Sen for his videoWhat is the Minimax Algorithm? - Artificial IntelligenceDevelopment & ContributingDevelopment of this happens on GitHub, patches including tests,
documentation are very welcome, as well as bug reports!See also ourCONTRIBUTING.md.CopyrightCopyright (c) 2020 Artsiom Platkouski.AP_gamesis licensed under the MIT License - see theLICENSE.txtfile for details.