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.
intelligence (AI) has long inspired me, and had spurred me on to come up with
interesting programs or projects that I had not imagined before.
Since great oaks from little acorns grow, this tic-tac-toe AI project is the
first and one of the most important programs I have made that can be said to
possess artificial intelligence. (~age 15, 2011)
Either with the player playing first or the computer, the AI will never lose! Being a very simple game that one could easily master, tic-tac-toe can yet be quite complex in a way in that there is actually a total of 255168 possible outcomes! Fig. 1 illustrates all the possible board states until the 5th move using an optimal strategy with the 1st move at the center (States that can arise from mirroring or rotating the shown states are excluded). The green circled states are those which the circles have won, and the yellow ones are those which the circles will eventually win while continuing to implement the optimal strategy. We can see that it actually gets quite complicated after the 3rd move.
Figure 1. Possible states of Tic-Tac-Toe until the 5th move starting from the center.
Since back then I knew nothing about algorithms (which I had started to learn at senior high school), I hard coded almost all the conditions using very basic syntax: If…Else…End If and For…Loop. The AI will sometimes move randomly, but it will always follow an optimized strategy. It took me ~650 lines of code and several days of hard work to complete.
This project demonstrated the possibility of programs to achieve human level performance for playing simple games. Although objectively not considered an astonishing one, I was surely amazed and unprecedentedly inspired by the potential of programming algorithms for AI; which further on motivated me to create AI programs of increasing difficulties (refer to Gomoku AI, Sudoku AI, Othello AI, Nonogram AI, Guess the Number AI, Minesweeper AI).
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.
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.
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.