Connect 4

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
edited 2013-03-11 in Download section
Connect 4
"Connect Four" or "Four on a row".
The more you play, the smarter he gets. The computer will never lose the same way as before, because he learns from previously plaid games. Well, until you clear his history table...

http://www.mibuso.com/dlinfo.asp?FileID=1531

Discuss this download here.

Comments

  • IsitarIsitar Member Posts: 29
    Very nice! i lost so many times.... :D
    Greetings from Switzerland
  • Peter_KuiperPeter_Kuiper Member Posts: 19
    Thanks!
    I enjoyed it very much to make this program. I liked to analyse what is a good move and what isn’t.
    Apart from the obvious choices (win when you can, prevent getting lost when possible and don’t give away your ‘traps’), the program is also searching for possibilities, and translates these into more or less points, depending on certain criteria. It is doing the same for his opponent (that is you), but then the points count negative. And it is using the history, like I wrote in the download-description already.
    I also lose from him more than I win. Only my son of 8 won several times in a row… :D
    Gr,
    Peter
  • Peter_KuiperPeter_Kuiper Member Posts: 19
    I found one bug which is fixed by making the following change (//01- .. //01+) in function canWinInOne:

    Function:
    canWinInOne(board : Code[50];columns : ARRAY [7] OF Integer;NoOfMoves : Integer;player : Integer;includeVertical : Boolean;VAR bestMove
    //CanWinInOne
    
    FOR col := 1 TO 7 DO BEGIN
      //01-
      //IF columns[col] <= 6 THEN BEGIN
      IF columns[col] < 6 THEN BEGIN  
      //01+
      ...
    
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
    Connect 4
    Update 12/08/2016:

    The download files contain an upgraded version for the classic client (NAV2009) with some improved features and a bugfix, and a modern version developed in NAV2015. This version uses DotNet objects from System.Drawing to draw the board.

    http://mibuso.com/downloads/connect-4

    Discuss this download here.
Sign In or Register to comment.