🧠 Connect 4 AI
h
LucHutton (177)

Just a simple but fast connect four AI made using HTML, CSS, JS.

How To Play:
The aim of the game is to get four of your counters (red) in row, this can be diagonally, horizontally or vertically. Each move click on one of the seven columns to drop your counter into that column.

How It Works:
1) Each potential place the AI can place a counter is scored based on the amount of counters around that place and the length of the segments around it also.
2) The move above is also checked to make sure that by moving to that position that the AI doesn't cause the player to win, or for the AI to sacrifice a potentially good move, if this is true then the score of that move becomes 0.
3) If there is one distinct highest score, that one is chosen, else the AI just picks a random move from the highest scoring moves.

REMEMBER TO UPVOTE!

PLAY HERE: https://Connect-4-AI--luchutton.repl.co

You are viewing a single comment. View All
Night_Shadow (2)

Doesn't do what i want it to

LucHutton (177)

@Night_Shadow What do you want it to do?