<aside> 🦠 Cellular automata with competitive AIs.

</aside>


Overview

This project was completed for my Honors Advanced Computer Science, Data Structures & Algorithms class. The objective was to create a competitive AI that would eliminate other AIs from the "society". I took inspiration from organic bacteria behaviors and bactericidal agents to create an algorithm, cleverly titled BactericAIdal (pronounced "bacteris-A-I-dal"), that is very effective at eliminating other players.

<aside> 🧑‍💻 Interested in seeing the code for this project? It is available on my GitHub at https://github.com/chroline/cellWars. The code powering BactericAIdal is located at src/BactericAIdal.java

</aside>


Assignment details

These are the instructions given for the assignment.

Objective

Here's how the game works:

Each player will get to design their own AI which must be a subclass of CellAI. The progression of the game is follows:

  1. The game is played on a square grid made of int values. Numbers that are 0 or larger in the grid represent player cells, while the value -1 indicates a dead cell. Each CellAI is given a unique id number. In a 4 player game, there will be 5 different values in the grid: -1, 0, 1, 2, and 3

  2. At the beginning, each player has their id number placed in random spots in the grid.

  3. The number of cells in the grid depends on the number of players - you can find information about this in the populateGrid method of the Simulation class.

  4. The first player loaded into the game selects a location in the grid to either

    a. kill a cell that is alive (A player can kill their own cell or an opponent's cell)

    b. spawn an offspring if the selected cell is dead