Skip to content

Aly Milich proposal#12

Open
atmilich wants to merge 4 commits intoCPRO-Session1:masterfrom
atmilich:master
Open

Aly Milich proposal#12
atmilich wants to merge 4 commits intoCPRO-Session1:masterfrom
atmilich:master

Conversation

@atmilich
Copy link
Copy Markdown

No description provided.

For my final project I would like to make a battleship game. The rules will be very similar to the classic board game except the user will be able to customize their level and how large/small they would like the board to be. The easier the level, the more ships will be placed on the board (for a higher probability of hitting the ships). Depending on how much time it takes to code the basic parts of the game, I may have the board write to an external file, but I most likely will just print the board and the computer's moves.
This project will use a lot of arrays and conditional statements. The board will be a 2D array and the conditional statements will represent different scenarios, for example if the user hits a ship. It will also use functions so, instead of rewriting what happens when a ship is hit, I can just call a function to change the score/lives. The entire game will be in a loop while the user has ships left.
I would like to make this project because Battleship is a popular game and I think that it combines many of the topics we have covered. I have made many games in the past in Java but this would be my first of this type and in C.
I plan on using the standard input/output library as well as <assert.h> to check if certain conditions are met (like hitting a ship) and <time.h> to choose random spots to place the ship. These are the only ones I can think of now but I may have to add more as I go.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the classic game of Battleship, the ships are of varying sizes. Do you plan on doing this or do you intend to just make them a fixed size? And does your player select where the ships will be placed or will they be random?

The project sounds good. A suggestion I have is to place your functions in separate files (the definitions go in .c files and the prototypes go in the corresponding .h file) to help keep things organized. Also, it may be interesting to implement a very simple AI for the computer (assuming your ships are larger than 1 in size), where the computer aims in a smaller radius around where it hit until it sinks a ship as opposed to continuing to randomly pick locations.

@atmilich atmilich closed this Jul 15, 2016
@atmilich atmilich reopened this Jul 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants