My Projects
Connect4 with AI
Connect4: "Connect 4" is a game, where you and your opponent put a coin of your color into a column and let it fall into the lowest row of that column, which isn't occupied by other coins. You take turns until one of you have an either horizontal, vertical or diagonal line of 4 coins of the same color, or if the field is full of coins and no other coin can be put in (draw/tie). This program is the computer version. I programmed it in Python 3 and it runs in the console or in a Python Interpreter. Here you have a 6x7 field (height x width), which can be filled up with 1s or 2s (if empty, 0). Who first gets a line of 4 of his number, wins.
connect4ai: This application is the addition to the Connect4 code. It adds an artificial intelligence (computer), which is (ideally) unbeatable, if it starts. For this I have tested 5 types, and it turns out that my last try (Type 5) works the best. It tries to simulate game scenarios, by testing out each possible move, and each possible move of the opponent. It takes many iterations of this process to get to the best possible move. Therefore the number of simulated games grow exponentially, which means that the computer needs time for this process.
Connect4cmd with AI: The problem with Python is, that it is a extremely-high-level programming language. Thus it takes too much time to calculate the best possible move. This is the reason, why I am translating the code from Python to Objective-C, which allows the calculation to be faster done.
DOWNLOAD Connect4 (w/o AI; 2 players)
DOWNLOAD Connect4cmd with AI (macOS; console)
DOWNLOAD Connect4cmd with AI Project Folder (Xcode Project)
April 2017