Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

C programming battleship game

25/03/2021 Client: saad24vbs Deadline: 7 Days

In this homework we will solve ship placement puzzles inspired by the pencil & paper “Battleship” game that was later made into a board game by Milton Bradley and then a puzzle that is a regular feature in Games magazine. You can read more about the history of the game and see examples here:

https://en.wikipedia.org/wiki/Battleship_(game)

https://en.wikipedia.org/wiki/Battleship_(puzzle)

This is a popular game with lots of material available online. You may not search for, study, or use any code related to the Battleship game or puzzle. Please carefully read the entire assignment and study the examples before beginning your implementation.

Battleship Puzzles - How to Play

Your program will accept one or two command line arguments. The first argument is the name of a battleship puzzle board file similar to the file shown below. This sample file begins with the dimensions of the board, in this case 4 rows and 5 columns. Next, we give the number of cells in each row and each column that are occupied by a ship. The other cells in the row are open water. Then, we have a simple list of the ships that must be placed on that board. All ships are 1 cell wide, but each ship type has a different length (# of cells): submarine = 1, destroyer = 2, cruiser = 3, battleship = 4, carrier = 5, cargo = 6, and tanker = 7.

board 4 5

rows 4 0 2 1

cols 1 2 1 2 1

cruiser

destroyer

submarine

submarine

4

1 2 1 2 1

1

2

0

Your task is to place the ships on the board satisfying the counts for each row. One important rule in placing the ships is that no two ships may occupy adjacent cells (including the diagonal). The sample puzzle above actually has two solutions. The diagram and sample output below show one of the solutions. Can you manually find the other?

Solution:

cruiser 0 0 horizontal

submarine 0 4

submarine 2 1

destroyer 2 3 vertical

+-----+

| o|4

| |0

| o ^ |2

| v |1

+-----+

12121

1

2

0

4

1 2 1 2 1

Output Formatting

To ensure full credit on the homework server, please format your solution exactly as shown above. The solution must begin with the keyword “Solution:”, followed by a line for each ship beginning with the ship type, the row and column of the upperleftmost cell occupied by the ship, and for non-submarine ships the orientation of the ship (“horizontal” or “vertical”). The ships may be listed in any order. After the ship

https://en.wikipedia.org/wiki/Battleship_(game)
https://en.wikipedia.org/wiki/Battleship_(puzzle)
placement details, you should make an ASCII art diagram of the solved board (this will help in debugging). However, this will be graded by the TAs not the automated grading on the homework server, so you may format your ASCII art diagram somewhat differently than the sample above.

If the optional second argument find_all_solutions is not specified, your program should output to std::cout any single valid solution to the puzzle. If the optional argument find_all_solutions is speci- fied, your program should output all valid, unique solutions (in any order) and then also print at the bottom the number of solutions found, e.g., “Found 2 solution(s)”. If the puzzle has no solutions, your program should print “No solutions”. When searching for all solutions, make sure you do not double count or du- plicate the same solution. For example, if a puzzle has two submarines, swapping the submarines does not make a “new” solution.

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Finance Professor
Accounting & Finance Specialist
Write My Coursework
Isabella K.
Engineering Solutions
Instant Assignment Writer
Writer Writer Name Offer Chat
Finance Professor

ONLINE

Finance Professor

I have read and understood all your initial requirements, and I am very professional in this task.

$49 Chat With Writer
Accounting & Finance Specialist

ONLINE

Accounting & Finance Specialist

I am known as Unrivaled Quality, Written to Standard, providing Plagiarism-free woork, and Always on Time

$52 Chat With Writer
Write My Coursework

ONLINE

Write My Coursework

I am known as Unrivaled Quality, Written to Standard, providing Plagiarism-free woork, and Always on Time

$27 Chat With Writer
Isabella K.

ONLINE

Isabella K.

I will cover all the points which you have mentioned in your project details.

$42 Chat With Writer
Engineering Solutions

ONLINE

Engineering Solutions

Hello, I an ranked top 10 freelancers in academic and contents writing. I can write and updated your personal statement with great quality and free of plagiarism

$94 Chat With Writer
Instant Assignment Writer

ONLINE

Instant Assignment Writer

I have read and understood all your initial requirements, and I am very professional in this task.

$30 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Unit 1.2 Helping the Poor. - PLAGIARISM FREE "A" WORK - Pride poem by dahlia ravikovitch - Pastor bayless conley net worth - INFRASTRUCTURE/LAYOUT OF DIFFERENT KITCHEN(no problem with plagiarism) Just Copy Paste - General liman von sanders - Solve the differential equation y xey - Wisdom sits in places chapter 4 summary - Chapter 4: Discussion - Myob write off bad debt - Cloud application development ppt - Week 6 - Assignment: Prepare a Checklist for Choosing an Ethical Mental Health Care Provider - Credentialed community language test - Essentials of business communication 9th edition pdf chapter 2 - Visualization training is vital because it __________ - InfoTech in a Global Economy - Easy rake silage facer for sale - Answers to voices of freedom questions - A packing plant fills bags with cement - Things fall apart questions and answers chapter 1 13 - Bank of queensland websaver - Assignment 2 social control and criminal deviance bullying - He nurses are responsible for her continuous care and doctors visit daily to review her condition and treatment. - Wikisummary - Chestnut hill hospital volunteer - Reviewing problems or issues and the cultural assessment - Redken spray starch 15 alternative - A set of data consists of observations - R Studio Lab 5 - What is master status in sociology - If poem by rudyard kipling meaning - The large piston in a hydraulic lift - How much is an racv vehicle inspection - Internal environment analysis example - Building a bridge out of popsicle sticks - Display the help document insert wordart - Ethics and law - Cv1 coffee maker - Learning experience plan childcare - Human physiology topics for presentation - Ktea 3 test description - Real life situations using linear equations - Gas laws pre lab answers - _____ is the ability of an advertising medium to reach a precisely defined market. - International microwave power institute - "Statute of Limitations" Please respond to the following: - Philippine bar exam questions and suggested answers - PSY-4500:Week 2 - Assignment: Analyze Experiments - 36 tom packer drive athelstone - Revenge in the tempest and hag seed - R410a condenser with r22 evaporator - Odessa, inc., reports the following information concerning operations for the most recent month: - 7 Discussion Board: Evolution, Malaria, and Mosquitoes - 1234567891011 find the mistake if you are genius answer - Java fundamentals a comprehensive introduction by herbert schildt pdf download - Shirley temple in the bluest eye - Essays guru only - Sheringham nursery north ryde - Piggyback and fishyback are forms of what logistics element - No-no boy essay 9AM - Do not fold spindle or mutilate who invented this card - Delta galil investor relations - Difference between hdi and hpi - British airways restructures its entire organization - Nantucket hammocks inc uses dealer incentives - What is morpheme and its types - Sample informative speech about technology - Klinefelter Syndrome - Why does freda crews wear so much makeup - Facing east from indian country sparknotes - Wells technical institute a school owned by tristana - To his coy mistress speaker - Greater than or equal to pseudocode - Training powerpoint - COMPUTER - Gt2 belt max load - Kidney yang deficiency weight gain - Quotes from the scarlet letter about hester accepting her sin - Week 7 ORG400 - Goli vada pav case study pdf - 703 stedman crescent albury - Adding scalar multiples of vectors graphically mastering physics - The longest memory context - Four case studies four page paper - Activity Plans - CHRISTIAN SERVANT LEADERS - Equivalent fractions for 10 15 - Pr 9 2a accounting - Mosfet differential amplifier small signal analysis - Acid and alkaline chart - Biology - Discussion 2.3 - Deriving test cases in white box testing - Families of elements worksheet answer key - Managing ethics and social responsibility - Explain the importance of establishing credibility for business communications - Greendale stadium case study answers - Project overrun case study - Toyota market segmentation targeting and positioning - Drywall repair clips home depot