Find Jobs
Hire Freelancers

Battleship game in JAVA (text mode)

€8-30 EUR

Completed
Posted over 9 years ago

€8-30 EUR

Paid on delivery
JAVA (OBJECT ORIENTATION) Implement the classic game of Battleship, which allows a human player (user) to face the computer (CPU player). 1. Review The game is played on two grids, one for each player. The grids are typically square – usually 10×10 – and the individual squares in the grid are identified by letter and number Before play begins, each player secretly arranges their ships on their grid. Each ship occupies a number of consecutive squares on the grid, arranged either horizontally or vertically. The number of squares for each ship is determined by the type of the ship. The types and numbers of ships allowed are the same for each player. There are two typical complements of ships: Type of ship Size Number per player aircraft carrier 5 1 battleship 4 2 frigate 3 2 submarine 2 2 The application will ask to the user to specify the location where he wants to place the ships, and will verify that the position of the ships is correct. The ships cannot overlap (i.e., only one ship can occupy any given square in the grid) and a ship cannot “touch” another ship. If the position of the ships is not correct, the application will ask the player to specify the ships location again. After the ships have been positioned by the user, the application will randomly set the location of the CPU player ships. The game proceeds in a series of rounds. User goes first, and the application will ask the user a grid (ie (2, 5)). If he hits his shoot, he will shoot again (successively). If he misses, his round is over. In the CPU player round, the application will generate a random grid and if it is a hit, the CPU will shoot again. The next shoot will be the grid on top of the previous hit, the grid on the right of the previous hit, the grid at the bottom of the previous hit, and the grid on the left of the previous hit. IN THAT ORDER. ie, if (3,5) is a hit, the next shoot will be (2,5). If it is another hit, next shoot will be (1, 5), and the CPU will look for the ship up and down. But if (2, 5) was a miss, the next shoot will be (3,6) and the CPU will look for the ship right and left. If (3,6) was a miss, the next shoot will be (4,5) and if (4,5) is a miss, the next shoot will be (3,4) When all of the squares of a ship have been hit, the ship is sunk, if all of a player's ships have been sunk, the game is over and their opponent wins. The application has to implement a mechanism to leave the game if the user doesn’t want to keep playing. 2. Application Restrictions - The board is 10 x 10, but everything should be indicated through constants so if you want to play in a 15 x 15 board, you can play simply by changing the value of the constant of 10 to 15 - No ships may be placed diagonally. - In the perimeter surrounding a ship you can´t place another ship - At home player's turn, the board is shown with the shots that have been made, the ships have sunk (placed on the board) and the state of our fleet (boats remaining afloat). - You can choose the way of representing the hits on the board and missed shots 3. Delivery The application will be coded in Java. Be warned that you must use the characteristics of the programming language (object orientation, inheritance ,etc .). Using the Java language in a “Unnatural" way (ie, using Java to use an imperative programming) is not allowed and the project will be rejected. You have to send a zip file which includes all source code files needed to execute the application and a text file with a detailed description of the main algorithms and structure of the application. **Further information will be sent to the developer**
Project ID: 6345496

About the project

3 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hi, I am placing my bid on your project because I have read the requirements and I am confident enough with my Java and algorithm skills. I am focused mostly on doing computer science work 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. Let me know if you are interested so I can start. Thanks.
€30 EUR in 1 day
4.9 (405 reviews)
6.8
6.8
3 freelancers are bidding on average €149 EUR for this job
User Avatar
Hi mate this is asad,i have a lot of experience in java programming,would surely do it for you,cheers :)
€66 EUR in 2 days
4.9 (17 reviews)
4.0
4.0
User Avatar
Hi, I am ready to start this project, Given me chance to start this one... I am ready within your budget and timeline....message me for more discussion............. . regards
€351 EUR in 20 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of SPAIN
Madrid, Spain
5.0
3
Payment method verified
Member since Aug 19, 2014

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.