top | item 33281916 Play against the computer – Connect Four game in JavaScript 25 points| pebcakID10T | 3 years ago |flydaddy.net | reply 24 comments order hn newest [+] [-] i13e|3 years ago|reply ICYI Connect Four is a solved game, you can read about it here: https://en.wikipedia.org/wiki/Connect_Four#Mathematical_solu... [+] [-] tromp|3 years ago|reply You can solve it yourself from scratch in a few minutes by running my Fhourstones benchmark [1]. Other interesting connect-4 tidbits may be found on my connect-4 page [2].[1] https://tromp.github.io/c4/fhour.html[2] https://tromp.github.io/c4/c4.html [+] [-] pebcakID10T|3 years ago|reply Yes, I may do a minimax version with a difficulty setting. That would be fun to do. load replies (1) [+] [-] isquaredr|3 years ago|reply Thanks for sharing! This sent me down the solvability path. It would be cool to have an ‘expert’ mode that plays the optimal strategy. [+] [-] ReaLNero|3 years ago|reply Your wish has been granted: https://connect4.gamesolver.org/ [+] [-] Pxtl|3 years ago|reply Ran into bug - AI beat me by creating a diagonal with the piece in the top rank and it did not count that as endgame. I was able to keep playing. [+] [-] pebcakID10T|3 years ago|reply Should be fixed now - an off by one error checking diagonals that hit the top of the board. Thanks! [+] [-] pebcakID10T|3 years ago|reply Yes, I need a bug report button. load replies (1) [+] [-] gus_massa|3 years ago|reply It would be nice to be able to click in any square in the board, instead of just the ones in the bottom. [+] [-] pebcakID10T|3 years ago|reply Good idea. Done. load replies (1) [+] [-] pebcakID10T|3 years ago|reply Just a fun little project I did. It's beatable, but not easy. [+] [-] duderific|3 years ago|reply It seems like going first is a disadvantage, since the AI can just play defensively until you are backed into a corner. load replies (2) [+] [-] POiNTx|3 years ago|reply How good is the AI and how was it made? load replies (1) [+] [-] pipeline_peak|3 years ago|reply The best trick I can think of is to reach a point where you can get connect four in two or more places and the bot can only cancel out one.
[+] [-] i13e|3 years ago|reply ICYI Connect Four is a solved game, you can read about it here: https://en.wikipedia.org/wiki/Connect_Four#Mathematical_solu... [+] [-] tromp|3 years ago|reply You can solve it yourself from scratch in a few minutes by running my Fhourstones benchmark [1]. Other interesting connect-4 tidbits may be found on my connect-4 page [2].[1] https://tromp.github.io/c4/fhour.html[2] https://tromp.github.io/c4/c4.html [+] [-] pebcakID10T|3 years ago|reply Yes, I may do a minimax version with a difficulty setting. That would be fun to do. load replies (1)
[+] [-] tromp|3 years ago|reply You can solve it yourself from scratch in a few minutes by running my Fhourstones benchmark [1]. Other interesting connect-4 tidbits may be found on my connect-4 page [2].[1] https://tromp.github.io/c4/fhour.html[2] https://tromp.github.io/c4/c4.html
[+] [-] pebcakID10T|3 years ago|reply Yes, I may do a minimax version with a difficulty setting. That would be fun to do. load replies (1)
[+] [-] isquaredr|3 years ago|reply Thanks for sharing! This sent me down the solvability path. It would be cool to have an ‘expert’ mode that plays the optimal strategy. [+] [-] ReaLNero|3 years ago|reply Your wish has been granted: https://connect4.gamesolver.org/
[+] [-] Pxtl|3 years ago|reply Ran into bug - AI beat me by creating a diagonal with the piece in the top rank and it did not count that as endgame. I was able to keep playing. [+] [-] pebcakID10T|3 years ago|reply Should be fixed now - an off by one error checking diagonals that hit the top of the board. Thanks! [+] [-] pebcakID10T|3 years ago|reply Yes, I need a bug report button. load replies (1)
[+] [-] pebcakID10T|3 years ago|reply Should be fixed now - an off by one error checking diagonals that hit the top of the board. Thanks!
[+] [-] gus_massa|3 years ago|reply It would be nice to be able to click in any square in the board, instead of just the ones in the bottom. [+] [-] pebcakID10T|3 years ago|reply Good idea. Done. load replies (1)
[+] [-] pebcakID10T|3 years ago|reply Just a fun little project I did. It's beatable, but not easy. [+] [-] duderific|3 years ago|reply It seems like going first is a disadvantage, since the AI can just play defensively until you are backed into a corner. load replies (2) [+] [-] POiNTx|3 years ago|reply How good is the AI and how was it made? load replies (1)
[+] [-] duderific|3 years ago|reply It seems like going first is a disadvantage, since the AI can just play defensively until you are backed into a corner. load replies (2)
[+] [-] pipeline_peak|3 years ago|reply The best trick I can think of is to reach a point where you can get connect four in two or more places and the bot can only cancel out one.
[+] [-] i13e|3 years ago|reply
[+] [-] tromp|3 years ago|reply
[1] https://tromp.github.io/c4/fhour.html
[2] https://tromp.github.io/c4/c4.html
[+] [-] pebcakID10T|3 years ago|reply
[+] [-] isquaredr|3 years ago|reply
[+] [-] ReaLNero|3 years ago|reply
[+] [-] Pxtl|3 years ago|reply
[+] [-] pebcakID10T|3 years ago|reply
[+] [-] pebcakID10T|3 years ago|reply
[+] [-] gus_massa|3 years ago|reply
[+] [-] pebcakID10T|3 years ago|reply
[+] [-] pebcakID10T|3 years ago|reply
[+] [-] duderific|3 years ago|reply
[+] [-] POiNTx|3 years ago|reply
[+] [-] pipeline_peak|3 years ago|reply