This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

craigsapp6395
craigsapp6395 presents ...

2021/2/23

Connect 4 (A.I.)

Let A.I. run on high speed for a while. Then toggle button to play as a user. Slow the speed down and beat the A.I. The algorithm is not great. After a few hundred trials, the A.I. will beat a random player about 75% of the time. However a human player should easily beat the A.I.

108 views / 12 in the last 7 days

1 vote | 0 in the last 7 days

Tags: None

Your browser does not support the canvas tag.
Oh, someone else who uses AI))) Do you use neural networks?
craigsapp6395craigsapp6395

2021/2/26

No, my system is probably fairly basic (in respect to other A.I. methods). I have never tried learning A.I. techniques but I used an algorithm that kept track of the different states and moves in the game. Then evaluated if the move was favorable (based on the ending outcome of the game). I kept track of a point system. I did something similar with the cracker barrel game with much better results :)
My first AI was the same. By the way, I advise you to study neural networks, a very useful thing! Soon I will probably post a new scenario with a good AI that will be universal for most games!!)) I've been coming to this for a long time! I wish you good luck in your studies!!!
If you are interested, you can see my scenario AntLife 2, there is clearly visible learning, but also visible disadvantages of the then AI. I was just starting out.
By the way, I don't quite know the rules of this game, can you tell me?
I will definitely check it out! The rules for connect 4. You win the game if you get four pieces in a row (horizontally, vertically, or diagonally).
You would want the AI to play for a few minutes. then slow the game down and hit the black button which changes to user play. Then you are the gold pieces trying to get 4 in a row.
Hey Question: When we export the scenario to the website, is it possible to change from World to World?

Want to leave a comment? You must first log in.

Who likes this?

Kostya20052011