Gomoku AI

Although entering a department different from Computer Science (CS), I still had a majority of acquainted people in NTU-CS. One day, a friend of mine who was studying in CS challenged me of making an AI of some board game. The two of us would make AIs of that game and try to win the other one using the AI. Thinking it might be some challenging but interesting subject, I started to make this Gomoku AI.

Figure 1. Game playing demonstration of the Gomoku AI program.

Being a board game with so many possible states (more than the Othello AI I had made when I was in junior high school, which only has a 8×8 grid) , it is considered overly time wasting for the AI to traverse all the possible combinations, even just within 10 moves! Game tree graphs, graph traversal algorithms (e.g. DFS, BFS) and optimal searching algorithms (e.g. Alpha–beta pruning, A*) are usually implemented for decreasing computational time and achieving the best strategy. In this project, I only used the depth-first search (DFS) algorithm, along with some hard coded optimization decisions to create this program. Although being able to place a few initial pieces successfully, the program suffers from a large amount of computational time being spent. Most of the time after a few moves, the program will just run for a few hours (or days) before taking the next move, which is obviously very a serious problem for the AI.

Nevertheless, the environment and rules of the Gomoku game engine was successfully constructed, which allowed two players to play against each other. Nowadays, these board game AI are usually designed using deep neural networks, such as AlphaGomoku, an Alpha-Go-based Gomoku AI. Constructing these AIs would be a possible future work for optimizing this game agent.

T-Rex Game

This is a simplified game mimicking the T-Rex dino game appearing on the “No Internet” google page. The motivation for making this comes from a YouTube video where a program learns to play the game at superhuman level using genetic algorithm. It was quite fascinating knowing the fact that nothing has to be taught in order to let this program acquire the ability to jump over obstacles, dodge birds … etc.. I made this game using C, with the console being the gameplay screen. However, due to the fact that characters instead of figures were drawn, the screen will always be in a flickering condition for renewing the screen at a rate such quickly.

[Download Game]

Blackjack

Blackjack is a well-known gambling game and is the most widely played casino game in the world. Numerous researches about this game had been carried out, including machine learning of optimal actions for playing the game (see reinforcement learning for solving Blackjack).

I got particularly interested in machine learning during graduate school. Thus, I made this simple Blackjack game program in order to construct a game environment for reinforcement learning of game agents for future work.

The game process is a single round of Blackjack, starting from player 0 being dealt 2 cards from the dealer. The player can either choose to “hit”, “stand” or “split” according to his cards. After the “stand” action is chosen or if he goes busted, The next player follows on.

I wrote this game using C language, which runs on a command prompt. While being simple, It can provide useful insights to game agents which can further learn on its own for achieving optimal behavior.