Skip to content

C++ program that creates a dynamically allocated grid array and a critter for a game

Notifications You must be signed in to change notification settings

gabrielwr/Critter_Squash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Critter_Squash

This is a "Critter Squash" game developed for a CS class assignment.

This program dynamically creates a grid based off of user input and then inserts a "C" character, denoting a critter, to a random position in that grid. Once this happens, the critter moves around the grid until it is no longer within the bounds of the grid after moving. The critter has four move options: up, down, left, right, and up. The critter is randomly given instructions on which direction to move based off of a random number created by the rand function.

The program returns "critter is squashed!" and the number of moves it took for the critter to move out of bounds of the grid. To test this program out for yourself, click here: http://cpp.sh/4ryny

Enjoy!

About

C++ program that creates a dynamically allocated grid array and a critter for a game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages