Skip to content

Latest commit

 

History

History
66 lines (50 loc) · 3.19 KB

README.md

File metadata and controls

66 lines (50 loc) · 3.19 KB

CPPND: Capstone Snake Game Example

This is a starter repo for the Capstone project in the Udacity C++ Nanodegree Program. The code for this repo was inspired by this excellent StackOverflow post and set of responses.

The Capstone Project gives you a chance to integrate what you've learned throughout this program. This project will become an important part of your portfolio to share with current and future colleagues and employers.

In this project, I added these features to accomplish the project rubric requirements:

  • Added an enemy in the game as an extra feature.
  • Loops, Functions, I/O
    • Using control structures and organizing the code in functions.
    • Accepting input from the user.
  • Object Oriented Programming
    • Using object oriented programming techniques.
    • Using appropriate access specifiers for members.
    • Using member initialization lists.
    • Member data that is subject to an invariant is hidden from the user.
    • Classes follow an appropriate inheritance hierarchy.
    • Overriding a virtual base class function.
  • Memory Management
    • Using RAII where appropriate.
    • Smart pointers used instead of raw pointers.

Rules of the Game

  • If enemy snake bites the player snake from its tail, player snake will get short.
  • If player snake touches the enemy snake, the player snake will die.
  • When player eats a food, gets a point. But the only way to win the game is staying alive before the enemy takes a bite itself!

Dependencies for Running Locally

Basic Build Instructions

  1. Clone this repo.
  2. Make a build directory in the top level directory: mkdir build && cd build
  3. Compile: cmake .. && make
  4. Run it: ./SnakeGame.

CC Attribution-ShareAlike 4.0 International

Shield: CC BY-SA 4.0

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

CC BY-SA 4.0