CSI ISP

Concept & Motivation

For our CSI ISP, my partner and I decided to recreate the Tic-Tac-Toe game but inside of shell.

Originally we planned on utilizing the graphical interface of IGIS for the game, but with only a two-person group, it proved extremely difficult and we chose to instead use shell console for the game.

Game Design

Our game had a multiplayer and singleplayer mode, in which we utilized a minimax algorithm for an unbeatable AI, the code segment for which will be displayed below.

Code

minimax

The minimax algorithm cycles through all possible moves through a complex mathematical algorithm to figure out the best move each possible turn, it could also be potentially used for unbeatable AIs in Chess and other logic based board games.

checkwin

The checkwin cycled through all possible ways to win a game of tic-tac-toe, to check if any of the conditions were fulfilled.

aimove

AI Move function utilizes the minimax algorithm to insert the best move for the AI in the game at every stage.

Conclusion

In conclusion the ISP had a bunch of different bumps in the road, from the implementation of IGIS being very difficult, to the minimax algorithm being very difficult to implement, but overall the finished product was very successful and you can contact MD Raeed or Anton Bily (who has graduated) to play the game.

Overall, CSI very obviously taught me the basic fundamentals of code in swift, but it also taught me important school lessons as in managing work and assignments, and collaborative skills.

Home Page