Inspiration

Battle Ships board game

What it does

Space Ship Battle is a game where players take turns playing against a computer, trying to take down each other's spaceship vessels. The game randomly places your and enemy ships on an 8x8 grid and features game stats, a hunt-and-target algorithm for the computer, and turn-based gameplay where successful hits grant bonus turns.

How we built it

We built the entire game in C. The core uses pointer arithmetic for efficient grid manipulation and memory management. We implemented a custom "AI" that you play against, with two modes: a random-hunt mode and a target mode. We realized that if the computer you were playing against just guessed random locations, it would be easy to beat it, and it wouldn't simulate real human behavior.

Challenges we ran into

Some challenges we ran into were determining how to declare and use function parameters most efficiently and correctly. Randomly placing space ships on the grid and making sure they were correctly placed in bounds using pointer arithmetic.

Accomplishments that we're proud of

We're proud to have built a fully functional game in C. The adaptive "AI" that you play against makes the game more challenging and enjoyable. The design looks elegant and is fun to play with, with an interesting space-themed storyline.

What we learned

This project pushed our C programming skills to new levels. We developed our skills using pointer arithmetic in a new, challenging context and learned how to manage game states. We learned to debug more efficiently in a larger program and to streamline operations using functions.

Built With

Share this project:

Updates