artificial-intelligence
Artificial Intelligence Python codes for solving puzzles and problems.
1. TIC-TAC-TOE (TWO USERS)
- A basic two user playable Tic-Tac-Toe game that uses your numpad as the position markers.
- Players take turn by turn to position their mark.
- The game does not have a GUI as of now. It is a console version.
INTERFACE
Numpad Keys For Placing The Mark
Tic-Tac-Toe Board
Positioning Your Mark
Game Over
2. TIC-TAC-TOE (USER vs AI)
- Instead of another user, the machine will play against you.
- Developed using basic algorithm and some Tic-Tac-Toe tricks
- I have played against it a thousand times and the highest I have gone is a DRAW.
- GIVE IT A TRY. CAN YOU BEAT IT?
INTERFACE
Numpad Keys For Placing The Mark
You Will Go First
Immediately The AI Plays
Play Until One Wins...
... Or It's A Draw
3. 8 - PUZZLE PROBLEM
-
There are 9 cells arranged in a 3x3 grid. Eight of them are numbered from 1 - 8 and one is left blank (in my case, I have numbered it to 0).
-
The rule of this game is to swap the blank cell with its adjacent cell and arrange the cells in ascending order (with the blank space in the last cell).
That is, convert this...
To this...
KEYBOARD BINDINGS
A - LEFT
S - DOWN
D - RIGHT
W - UP
GOAL STATE
TRY SOLVING THE PUZZLE. IF STUCK, THEN LOOK MY NEXT TOPIC :)
4. 8 - PUZZLE PROBLEM SOLVER (AI)
- Uses BEST FIRST SEARCH to find the optimum solution.
- Heuristic function used is MANHATTAN DISTANCE
- Feed the 8 - puzzle problem board values and it will spit out the steps.
- Solves the problem blazing fast!
FEED THE BOARD VALUES
THE SOLUTION
This repository was created solely to discuss the various Artificial Intelligence codes in Python that can be used to solve puzzles and problems. If you have any idea or algorithm, please feel free to update this repository as it will help all of us to grow as a community.