Code Monkey home page Code Monkey logo

connect-4-minimax-ai's Issues

scenario that I used to win, you can use it to improve the program

see attached my winning scenario.
scenario_connect4_won.txt

--
% python3 Connect4_Game.py
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
Player 1's Turn
select a column 1-7: 4

CONGRATULATIONS you played the best move for this scenario

0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 1 0 0 0

Player 2's Turn
Ai is thinking with a depth of 6
MinMax Algorithm took 0.7464492321014404s to run at a depth of 6

0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 2 0 0 0
0 0 0 1 0 0 0

The AI has played column 4

Player 1's Turn
select a column 1-7: 4

CONGRATULATIONS you played the best move for this scenario

0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 2 0 0 0
0 0 0 1 0 0 0

Player 2's Turn
Ai is thinking with a depth of 6
MinMax Algorithm took 2.25075626373291s to run at a depth of 6

0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 2 0 0 0
0 0 0 1 0 0 0
0 0 0 2 0 0 0
0 0 0 1 0 0 0

The AI has played column 4

Player 1's Turn
select a column 1-7: 4

That was not the best move
You should have played column 6

0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 2 0 0 0
0 0 0 1 0 0 0
0 0 0 2 0 0 0
0 0 0 1 0 0 0

Player 2's Turn
Ai is thinking with a depth of 6
MinMax Algorithm took 2.8082640171051025s to run at a depth of 6

0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 2 0 0 0
0 0 0 1 0 0 0
0 0 0 2 0 0 0
0 0 0 1 2 0 0

The AI has played column 5

Player 1's Turn
select a column 1-7: 2

That was not the best move
You should have played column 3

0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 2 0 0 0
0 0 0 1 0 0 0
0 0 0 2 0 0 0
0 1 0 1 2 0 0

Player 2's Turn
Ai is thinking with a depth of 6
MinMax Algorithm took 1.6331062316894531s to run at a depth of 6

0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 2 0 0 0
0 0 0 1 0 0 0
0 0 0 2 2 0 0
0 1 0 1 2 0 0

The AI has played column 5

Player 1's Turn
select a column 1-7: 2

That was not the best move
You should have played column 3

0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 2 0 0 0
0 0 0 1 0 0 0
0 1 0 2 2 0 0
0 1 0 1 2 0 0

Player 2's Turn
Ai is thinking with a depth of 6
MinMax Algorithm took 1.3235938549041748s to run at a depth of 6

0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 2 0 0 0
0 0 0 1 0 0 0
0 1 0 2 2 0 0
0 1 2 1 2 0 0

The AI has played column 3

Player 1's Turn
select a column 1-7: 5

CONGRATULATIONS you played the best move for this scenario

0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 2 0 0 0
0 0 0 1 1 0 0
0 1 0 2 2 0 0
0 1 2 1 2 0 0

Player 2's Turn
Ai is thinking with a depth of 6
MinMax Algorithm took 1.6202051639556885s to run at a depth of 6

Depth increased to 7
0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 2 2 0 0
0 0 0 1 1 0 0
0 1 0 2 2 0 0
0 1 2 1 2 0 0

The AI has played column 5

Player 1's Turn
select a column 1-7: 2

That was not the best move
You should have played column 5

0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 2 2 0 0
0 1 0 1 1 0 0
0 1 0 2 2 0 0
0 1 2 1 2 0 0

Player 2's Turn
Ai is thinking with a depth of 7
MinMax Algorithm took 5.060753107070923s to run at a depth of 7

Depth increased to 8
0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 2 0 2 2 0 0
0 1 0 1 1 0 0
0 1 0 2 2 0 0
0 1 2 1 2 0 0

The AI has played column 2

Player 1's Turn
select a column 1-7: 5

That was not the best move
You should have played column 4

0 0 0 0 0 0 0
0 0 0 1 1 0 0
0 2 0 2 2 0 0
0 1 0 1 1 0 0
0 1 0 2 2 0 0
0 1 2 1 2 0 0

Player 2's Turn
Ai is thinking with a depth of 8
MinMax Algorithm took 3.2922990322113037s to run at a depth of 8

Depth increased to 9
0 0 0 2 0 0 0
0 0 0 1 1 0 0
0 2 0 2 2 0 0
0 1 0 1 1 0 0
0 1 0 2 2 0 0
0 1 2 1 2 0 0

The AI has played column 4

Player 1's Turn
select a column 1-7: 1

That was not the best move
You should have played column 5

0 0 0 2 0 0 0
0 0 0 1 1 0 0
0 2 0 2 2 0 0
0 1 0 1 1 0 0
0 1 0 2 2 0 0
1 1 2 1 2 0 0

Player 2's Turn
Ai is thinking with a depth of 9
MinMax Algorithm took 7.416490077972412s to run at a depth of 9

Depth increased to 10
0 0 0 2 2 0 0
0 0 0 1 1 0 0
0 2 0 2 2 0 0
0 1 0 1 1 0 0
0 1 0 2 2 0 0
1 1 2 1 2 0 0

The AI has played column 5

Player 1's Turn
select a column 1-7: 2

That was not the best move
You should have played column 1

0 0 0 2 2 0 0
0 1 0 1 1 0 0
0 2 0 2 2 0 0
0 1 0 1 1 0 0
0 1 0 2 2 0 0
1 1 2 1 2 0 0

Player 2's Turn
Ai is thinking with a depth of 10
MinMax Algorithm took 7.351132154464722s to run at a depth of 10

Depth increased to 11
0 0 0 2 2 0 0
0 1 0 1 1 0 0
0 2 0 2 2 0 0
0 1 0 1 1 0 0
0 1 0 2 2 0 0
1 1 2 1 2 2 0

The AI has played column 6

Player 1's Turn
select a column 1-7: 6

CONGRATULATIONS you played the best move for this scenario

0 0 0 2 2 0 0
0 1 0 1 1 0 0
0 2 0 2 2 0 0
0 1 0 1 1 0 0
0 1 0 2 2 1 0
1 1 2 1 2 2 0

Player 2's Turn
Ai is thinking with a depth of 11
MinMax Algorithm took 23.145294189453125s to run at a depth of 11

Depth decreased to 10
0 0 0 2 2 0 0
0 1 0 1 1 0 0
0 2 0 2 2 0 0
0 1 0 1 1 2 0
0 1 0 2 2 1 0
1 1 2 1 2 2 0

The AI has played column 6

Player 1's Turn
select a column 1-7: 6

CONGRATULATIONS you played the best move for this scenario

0 0 0 2 2 0 0
0 1 0 1 1 0 0
0 2 0 2 2 1 0
0 1 0 1 1 2 0
0 1 0 2 2 1 0
1 1 2 1 2 2 0

Player 2's Turn
Ai is thinking with a depth of 10
MinMax Algorithm took 9.923530101776123s to run at a depth of 10

0 0 0 2 2 0 0
0 1 0 1 1 2 0
0 2 0 2 2 1 0
0 1 0 1 1 2 0
0 1 0 2 2 1 0
1 1 2 1 2 2 0

The AI has played column 6

Player 1's Turn
select a column 1-7: 6

That was not the best move
You should have played column 1

0 0 0 2 2 1 0
0 1 0 1 1 2 0
0 2 0 2 2 1 0
0 1 0 1 1 2 0
0 1 0 2 2 1 0
1 1 2 1 2 2 0

Player 2's Turn
Ai is thinking with a depth of 10
MinMax Algorithm took 1.342369556427002s to run at a depth of 10

Depth increased to 11
0 2 0 2 2 1 0
0 1 0 1 1 2 0
0 2 0 2 2 1 0
0 1 0 1 1 2 0
0 1 0 2 2 1 0
1 1 2 1 2 2 0

The AI has played column 2

Player 1's Turn
select a column 1-7: 7

That was not the best move
You should have played column 1

0 2 0 2 2 1 0
0 1 0 1 1 2 0
0 2 0 2 2 1 0
0 1 0 1 1 2 0
0 1 0 2 2 1 0
1 1 2 1 2 2 1

Player 2's Turn
Ai is thinking with a depth of 11
MinMax Algorithm took 0.06806206703186035s to run at a depth of 11

Depth increased to 12
0 2 0 2 2 1 0
0 1 0 1 1 2 0
0 2 0 2 2 1 0
0 1 0 1 1 2 0
0 1 0 2 2 1 2
1 1 2 1 2 2 1

The AI has played column 7

Player 1's Turn
select a column 1-7: 7

CONGRATULATIONS you played the best move for this scenario

0 2 0 2 2 1 0
0 1 0 1 1 2 0
0 2 0 2 2 1 0
0 1 0 1 1 2 1
0 1 0 2 2 1 2
1 1 2 1 2 2 1

Player 2's Turn
Ai is thinking with a depth of 12
MinMax Algorithm took 0.0269320011138916s to run at a depth of 12

Depth increased to 13
0 2 0 2 2 1 0
0 1 0 1 1 2 0
0 2 0 2 2 1 2
0 1 0 1 1 2 1
0 1 0 2 2 1 2
1 1 2 1 2 2 1

The AI has played column 7

Player 1's Turn
select a column 1-7: 7

CONGRATULATIONS you played the best move for this scenario

0 2 0 2 2 1 0
0 1 0 1 1 2 1
0 2 0 2 2 1 2
0 1 0 1 1 2 1
0 1 0 2 2 1 2
1 1 2 1 2 2 1

Player 2's Turn
Ai is thinking with a depth of 13
MinMax Algorithm took 0.011472225189208984s to run at a depth of 13

Depth increased to 14
0 2 0 2 2 1 2
0 1 0 1 1 2 1
0 2 0 2 2 1 2
0 1 0 1 1 2 1
0 1 0 2 2 1 2
1 1 2 1 2 2 1

The AI has played column 7

Player 1's Turn
select a column 1-7: 1

CONGRATULATIONS you played the best move for this scenario

0 2 0 2 2 1 2
0 1 0 1 1 2 1
0 2 0 2 2 1 2
0 1 0 1 1 2 1
1 1 0 2 2 1 2
1 1 2 1 2 2 1

Player 2's Turn
Ai is thinking with a depth of 14
MinMax Algorithm took 0.0053560733795166016s to run at a depth of 14

Depth increased to 15
0 2 0 2 2 1 2
0 1 0 1 1 2 1
0 2 0 2 2 1 2
2 1 0 1 1 2 1
1 1 0 2 2 1 2
1 1 2 1 2 2 1

The AI has played column 1

Player 1's Turn
select a column 1-7: 1

CONGRATULATIONS you played the best move for this scenario

0 2 0 2 2 1 2
0 1 0 1 1 2 1
1 2 0 2 2 1 2
2 1 0 1 1 2 1
1 1 0 2 2 1 2
1 1 2 1 2 2 1

Player 2's Turn
Ai is thinking with a depth of 15
MinMax Algorithm took 0.0022430419921875s to run at a depth of 15

Depth increased to 16
0 2 0 2 2 1 2
0 1 0 1 1 2 1
1 2 0 2 2 1 2
2 1 0 1 1 2 1
1 1 2 2 2 1 2
1 1 2 1 2 2 1

The AI has played column 3

Player 1's Turn
select a column 1-7: 3

CONGRATULATIONS you played the best move for this scenario

0 2 0 2 2 1 2
0 1 0 1 1 2 1
1 2 0 2 2 1 2
2 1 1 1 1 2 1
1 1 2 2 2 1 2
1 1 2 1 2 2 1
##############################
The Player has won
##############################
0 2 0 2 2 1 2
0 1 0 1 1 2 1
1 2 0 2 2 1 2
2 1 1 1 1 2 1
1 1 2 2 2 1 2
1 1 2 1 2 2 1
%

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.