Page 3 of 3 FirstFirst 123
Results 21 to 22 of 22

Thread: Four-in-a-row (FlashPascal program)

  1. #21
    I made a quick modification inspired by SilverWarior's suggestion.

    I hope the code is clearer than my explanation would be.

    Code:
        aux := Max(a);
        
        //if Max(a) >= BONUS[3] then
    
        if (aux >= BONUS[4]) or (aux >= BONUS[3]) and (RandomAB(1, 2) < 2) then
          result := IndexOf(a, Min(a))
    And here is an example of a bad move than the previous formula used to avoid : DDCC (computer plays black).
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Roland Chastain; 20-04-2014 at 09:49 AM.

  2. #22
    the difference is noticeable there is some randomness in the AI's decisions, but very often that leads to bad moves. still can't beat me=)

Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •