Closed

Battleship using Arrays in C++ program - Repost - open to bidding

Battleship

Ye’ve been sailing the high seas for some time now. After a treacherous voyage through a raging storm, yer ship is off course afloat through unchartered waters. The morn’ after, the crew wakes up to find themselves amongst ravenous great white sharks1, Titanic-sinking icebergs, and an enormous British battleship loaded to the hilt with soldiers and artillery. Ironically, they’re on patrol looking for plunderin’, pillaging pirate ships. Not that your crew ever plunders or pillages, but these activities will definitely have to be put on hold until ye’ve navigated yer way out of these hostile waters!

1 Think “Jaws”.

2 Pirates certainly have enough gold and jewels to buy high powered canons and return enemy fire if they so desired but they typically spend it on ale and potato chips.

Here is a rundown of your current situation.

• One British battleship.

• Very hungry great white sharks that fancy pirates because they tend to taste like ale.

• Random icebergs. In addition, the entire perimeter of the oceanic area described is made up of icebergs that formed in the night.

• A single exit point from the wall of surrounding icebergs that will release your ship into the open sea for escape.

In planning, you pull out some clean scroll paper and plot out the immediately surrounding ocean. It’s represented by a grid that is 30 spaces wide and 15 lines long, each point representing a square nautical mile. You will be repeatedly asked what direction you want to move. Each time you move, you must try to avoid hitting, or being hit/eaten by an iceberg or a shark (remember, they’re very big and like to eat pirates), or being blasted by the Brits. You are within range of the Brits if you are in an adjacent square to their war vessel, including diagonal squares. It’s almost certain that your ship will be obliterated by cannon fire2.

Strategy:

• Ask the pirate for the name of the map file. This may not be hardcoded.

• Open the file and read in exactly 15 lines with exactly 30 integers per line.

• The map file is coded as follows:

o 0 = open sea

o 1 = iceberg

o 2 = shark

o 3 = British battleship

o 4 = the escape position

o 5 = your pirate ship

• Keyboard commands will move your ship as follows (lowercase):

o ‘n’ means north, or one row above your current position.

o ‘e’ means east, or one column to the right of your current position.

o ‘s’ means south, or one row below your current position.

o ‘w’ means west, or one column to the left of your current position.

o Any other keyboard entry means your ship stays in the same position as a penalty3.

• Each time you move, the battleship and all the sharks move one space toward you.

o Warning, they can also navigate diagonally, i.e., northeast, northwest, southeast and southwest. Your ship cannot do this with its outdated technology.

o The battleship destroys anything in its path – icebergs4, sharks, and, unfortunately, you. That means if a battleship moves to a position where an iceberg was, when it moves away, that map position becomes open sea. The same goes for sharks.

o If two sharks collide, only one is left.

• The ocean map should be displayed on the screen after each time you move and after the battleship and all of the sharks have moved.

• The scenario continues until you reach the exit point or until the sharks or the Brits have eliminated you5 or you carelessly navigate into an iceberg.

• Once the scenario has reached a conclusion, print out what happened. (Did the pirate ship escape? Get blown to bits? Become human sushi?)

Please Check the uploaded files.

Skills: C++ Programming

See more: yer, what is in c programming, what is big o, using re, the big o 1, programming technology c++, o 1 space, map in c, map cplusplus, in line program, human programming, get in c programming, find chips, escape to the southeast, c programming course, c++ programming commands, c programming commands, c programming arrays, cplusplus map, c map programming, big w, big o time, big o 2, arrays in programming, arrays in c programming

About the Employer:
( 0 reviews ) Canton, United States

Project ID: #5194936

9 freelancers are bidding on average $90 for this job

it2051229

Hi, I am placing my bid on your project because I have read the requirements and I am confident enough with my C++ and algorithm skills. I have implemented this same problem statemene before and I can create a unique o More

$50 USD in 0 days
(87 Reviews)
5.3
hbxfnzwpf

I am very proficient in c, c++. I have 15 years c++ developing experience now, and I have worked for 5 years. My work is online game developing, and mainly focus on server side, the lauguage is c++ under linux os. So, More

$54 USD in 2 days
(21 Reviews)
5.2
rakib062

Hi, I am a graduate in CS and working as a C++ programmer for 3+ years. I have done lots of assignments both in academic courses and in freelancer.com. I assure you of clean, efficient code with proper comment and More

$133 USD in 3 days
(18 Reviews)
4.2
zabolotniipavel

Hello. I have a great experience in developing different games for US student's projects. See my profile to be sure that I'm really a good freelancer. Please, if you are interested in my proposal, contact me for other More

$70 USD in 5 days
(2 Reviews)
1.4
Analist

Hi! You are miss to upload files! And am I right - it should be command-line style (console style) game for Windows on C++ with some gameplay logic but without art. Right?

$263 USD in 5 days
(0 Reviews)
3.7
patrickivory

Hello, I recently finished my bachelor of engineering (electrical) from University of Newcastle, currently I am working full time for two small engineering firms, whilst using freelancer projects to improve my codin More

$111 USD in 4 days
(0 Reviews)
0.0
drysder

Hi. I've been coding in C++ for about fifteen years. I could have this done for you pretty quickly. The description mentions "uploaded files". Will you be providing them to the selected coder? Thanks. Jim

$63 USD in 3 days
(0 Reviews)
0.0
saobang972

Dear sultanaltawil, That to be my pleasure to help you complete your assignment, It's seem to simple to me. Please let me know if you have interesting with my proposal.

$35 USD in 1 day
(0 Reviews)
0.0
PatWoj

Hi, i'm a gaming enthusiast and a coder. Your task is something i can do without problems, you can count on me.

$100 USD in 3 days
(0 Reviews)
0.0
nanook889

Hello. I have read the description in full and I am confident that I can quickly program this game for you. Upon completion of this project I will deliver a Visual Studio (2010) solution and/or the .cpp and .h files. T More

$40 USD in 1 day
(0 Reviews)
0.0