• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

I need help with my Connect Four java game.

naruto1988

Golden Member
it's a simple game played at the command line. the game engine is a two-dimensional array. here's a screenshot.

the two-player portion of the game works fine, but i'm having trouble building my AI. my bestMove method consists of 4 smaller methods. i'm working on the easiest of the small methods. its function is: if a row is empty except for two consecutive cells, block the opponent from getting three in a row.

here is the full code. and here's the portion i need help with:
 
Back
Top