1 / 5

Connect K

Connect K. Richard Fang rfangAI. Heuristic. Choose the move that results in the most unblocked (the opponent does not share the same row/col/diagonal) contiguous lines for the player. Weighted by line length Ex: 5 x 5 , K = 4 next move : red. numbers are the number of lines

orrick
Download Presentation

Connect K

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Connect K Richard Fang rfangAI

  2. Heuristic Choose the move that results in the most unblocked (the opponent does not share the same row/col/diagonal) contiguous lines for the player. Weighted by line length Ex: 5 x 5 , K = 4 next move : red numbers are the number of lines * even though it is the same length as the other moves, the resulting line is longer.

  3. Actual Result: 5 x 5 K = 4 3.jpg

  4. Prioritized Checks 1. Take the middle spot if available (W/2, H/2) 2. Take the spot if player will win (at depth 0) 3. Take the spot if player will lose (at depth 0) 4. Take spot if opponent will have k - 1 in a row to avoid this scenario → 5. Take spot if player will have k - 1 in a row to be in this scenario →

  5. Other tips - Don’t check all available spots - Only check spots that are adjacent to existing pieces - Focus on getting the min/max algorithm working before adding other constraints (time limit, alpha pruning, etc) - Step through your algorithm by hand if needed

More Related