Find Jobs
Hire Freelancers

Battleship using Arrays in C++ program

$30-250 USD

Ολοκληρώθηκε
Αναρτήθηκε πάνω από 10 χρόνια πριν

$30-250 USD

Πληρωμή κατά την παράδοση
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.
Ταυτότητα εργασίας: 5129900

Σχετικά με την εργασία

1 proposal
Απομακρυσμένη Εργασία
Ενεργός/ή 10 χρόνια πριν

Ψάχνεις τρόπο για να κερδίσεις μερικά χρήματα;

Πλεονεκτήματα πλειοδοσίας στο Freelancer

Καθόρισε τον προϋπολογισμό σου και το χρονοδιάγραμμα
Πληρώσου για τη δουλειά σου
Περίγραψε την πρόταση σου
Η εγγραφή και η πλειοδοσία σε εργασίες είναι δωρεάν
Βραβεύτηκε στον/στην:
Avatar Χρήστη
Hi, I am placing my bid on your project because I have read the requirements and I am confident enough with my C++ skills. I am focused mostly on doing computer science homework here in freelancer.com and I would like to help you get this project done if you would give me the opportunity. I am a computer science professor and practitioner and this assignment is one of the fields that I teach very well so I can assure you an accurate result.
$60 USD σε 0 ημέρα
4,9 (80 αξιολογήσεις)
5,2
5,2

Σχετικά με τον πελάτη

Σημαία της UNITED STATES
Stow, United States
5,0
2
Επαληθευμένη μέθοδος πληρωμής
Μέλος από Νοε 1, 2013

Επαλήθευση Πελάτη

Άλλες δουλειές από αυτόν τον πελάτη

C++ program using LOOPS and Files
$30-250 USD
Ευχαριστούμε! Σου έχουμε στείλει ένα email με ένα σύνδεσμο για να διεκδικήσεις τη δωρεάν πίστωση σου.
Κάτι πήγε στραβά κατά την προσπάθεια αποστολής του email σου. Παρακαλούμε δοκίμασε ξανά.
Εγγεγραμμένοι Χρήστες Συνολικές Αναρτημένες Δουλειές
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Φόρτωση προεπισκόπησης
Δόθηκε πρόσβαση για Geolocation.
Η σύνδεση σου έχει λήξει και τώρα έχεις αποσυνδεθεί. Παρακαλούμε συνδέσου ξανά.