Giter Club home page Giter Club logo

battleship's People

Contributors

eternal-flame085 avatar joselopez235 avatar kevxo avatar miguelsilva1997 avatar

Watchers

 avatar

battleship's Issues

Create valid_placement? method

Requires 2 arguments one will be the ship and the second will be an array of coordinates where the ship will be located. Needs to check if the length of the array is the same size as the ships length, make sure the array numbers are consecutive, and finally coordinates cannot be diagonal.

Create hit method

This method will decrease one out of health if called upon. Make sure you check if this functionality is set in place.

This issue needs to be addressed first. #3

Create place ship

Seems to me that this is going to take one argument. Which is a ship class and will save it in the ship method.

Please verify if this issue is completed first. #7

Create health method

It seems that the health method is always the same as the length. Only one difference, it seems to be mutable so I believe we need to make sure that whenever we update the health method we do not update the length method.

Create the ship method

Seems to me that this will store a ship that is located at this coordinate. If there is nothing located it will return nil.

Create fire_upon

This method should check first that fired_upon? is not true. If is false change fired_upon? to true and make sure that if there is a ship in this coordinate then call the hit method in the ship.

Create render method

Requires an optional argument of a bool. The render class should display many options, ” . ” if the cell has not been fired upon. “M” if the cell has been fired upon and it does not contain a ship (the shot was a miss). “H” if the cell has been fired upon and it contains a ship (the shot was a hit). “X” if the cell has been fired upon and its ship has been sunk. And the optional bool argument will be false normally but if someone passes true, make it were all ships will be visible with "S", this will be useful for showing the user where they placed their ships and for debugging.

Create player attack method

This method should do the following

  • record the attack
  • display_info
  • if won return you won
  • if hasnt won call ai_turn

Create adjacent cell method

This method will check once the A.I have gotten a hit on a ship, to see if the cells adjacent have a ship.

Create place method

Requires 2 arguments the first is the ships name and an array of coordinates. This will place the ship where they are being specified.

Create logical_strikes method

This method will make the A.I not make a bad move when it comes to finishing off a ship for example if the A.I has hit (A1 and A2) this would make the A.I hit (A3) and not another cell like (B2).

Requires issue #38

Create create_ship method

Allow users to create there own ships(except if the board is in its original state then only allow submarine and carrier ships)

Player ship prompt

Should display welcome message and then call generate ships. After that loop generate ships so it goes into player input. Calls player ship input. Then player turn.

Create cell method

Must create a hash with the board, it will contain all the cells depending on the size of the board.

Create coordinate class

This will save the coordinate pass in the initializer. Seems to be that only a reader is necessary.

Create winner method

Game ends when all the user’s ships are sunk.
Game ends when all the computer’s ships are sunk
Game reports who won

Create Sunk method

This method will programmatically check if the ship has been sunk. Find a way to do this. My guess it has to do with the health method.

This will return a bool, so name the method accordingly.

Create render method

Requires an optional bool argument. This method should render the board for that we can see the board on display. The bool argument is for when we pass an argument of true it will display all the ships on the board.

Create fired_upon?

This method checks if this specific coordinate has been hit. Making sure that it does not get hit twice. So make sure to change this bool to true if it has been hit before.

Create player_attack method

User can choose a valid coordinate to fire on. Entering invalid coordinate prompts user to enter valid coordinate

User is informed when they have already fired on a coordinate

Create player_ship_location method

User can enter valid sequences to place both ships

Next, the user places their ships. They should receive a short explanation of how to place along with a visual representation of their board (which should be empty.

Entering invalid ship placements prompts user to enter valid placements

If more information is needed look at the project details

Create Reader for name and length

In the Ship class make sure to create the methods name and length to save the in initialized arguments. Please evaluate if also we need a writer if so make sure to create an accessor.

player_ship_input

ship is ship class, gets the user input, if valid calls player_ship_placement, if not valid calls player_ship_input(ship).

Create destroy method

If hunt method hit a ship, then make the A.I fire upon the adjacent cells until ship is destroyed.

requires issue #38 and #39

Create ai_turn method

record the attack
display_info
if won return you won
if hasn't won call player_turn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.