Python Projects

Python Projects

In the summer of 2014 I took the Rice University’s Principles of Computing online course (taught in Python), which “introduces the basic mathematical and programming principles that underlie much of Computer Science”. The main focus of this course were the weekly mini-projects (strategy-based games) that built upon those principles every week. Here is a bit about each project:

2048

For our first project we had to implement the popular smart phone game 2048 (play it here). Concepts learned:

  • Coding standards
  • Testing
  • Plotting

Tic-Tac-Toe (Monte Carlo)

For this mini-project our goal was to use Monte Carlo simulations in order to pick the next best move for the machine player. You can play my version here. Concepts learned:

  • Probability
  • Randomness
  • Objects/references

Yahtzee

For this game we had to implement a strategy function designed to help us choose which dice to hold after our second roll of the dice. The function was supposed to consider all possible choices of dice to hold and recommend the choice that maximises the expected value of our score after the final roll. You can play my version of Yahtzee here. Concepts learned:

  • Combinatorics
  • Generators
  • Debugging

Zombie Apocalypse

For this mini-project we had to produce a game where humans were being chased by zombies. Humans continue to live even if caught but the zombie gets to eat some human brain. Zombies move up, down, left and right, while humans can also move diagonally. You can play my version of the game here. Concepts learned:

  • Searching (BFS)
  • Data structures
  • Inheritance

Word Wrangler

We had to implement a simple word game, which takes an input word and then generates all valid words that can be created using the letters in the input word. You can play it here. Concepts learned:

  • Recursion
  • Sorting
  • Reading files

Tic-Tac-Toe (Mini-max)

The brief was to implement a machine player for Tic-Tac-Toe that uses a Mini-max strategy to decide its next move. Although the game is played on a 3×3 grid, our version had to handle any square grid. You can play my version of the game here. Concepts learned:

  • Trees
  • Game solvers
  • Testing