Coder Social home page Coder Social logo

battleship's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @hopesgit or Hope!
  • ๐Ÿ‘€ Iโ€™m interested in video games, solving problems, and making things work!
  • ๐ŸŒฑ Iโ€™m currently learning Ruby, Python, and C++
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on something that helps others!

battleship's People

Contributors

hopesgit avatar jessemellinger avatar

Watchers

 avatar

battleship's Issues

Iteration 4: Variable board size

This should allow the user to select the proportions of the board. Functionality should include:

  • length input by the player
  • width input by the player
  • needs to initialize as many cells as needed to fit the requirements
  • must be tested completely

Iteration 3: Player Class

This should handle all aspects of a player and its actions. This should be able to:

  • Instantiate
  • Attack the other player's board
  • Place ships on its own board
  • Win/lose
  • whatever else we decide!

Iteration 2: Board valid_placement? method

This method should take two arguments:

  • a ship object
  • an array of coordinates
    This method should check (and test!) a few things related to the placement of the ship:
  • the length of the ship object
  • the length of the array
  • the length of the array matches the ship's length
  • the ship is being placed on consecutive cells
  • the ship isn't being placed diagonally
  • the ship is being placed completely on the board
    This should also actually place the ship onto the selected cells

Iteration 2: Board valid_coordinate? method

This should take the form a method for checking coordinates that can report a boolean argument.
Criteria:

  • the coordinate should be in the form
  • the coordinate should be a coordinate that can go on the board

Iteration 3: Game winner

Game should be able to:

  • Detect that someone has won
  • Be able to tell which player has won
  • Give output of which player won
  • Be able to end when winner is detected
  • Ask the player to play again

Iteration 2: Board render method

Simple in concept, tough in execution.
This render method should render the state of each cell in the player's board to the terminal. It should also take an optional argument to render S's instead of .'s in the places where that's appropriate.

Iteration 4: Custom ships

This should allow the user to create custom ships. These ships will have the following attributes, all customizable:

  • name
  • length
  • health (uses length)

Board render fix

Board render isn't exactly to spec due to needing the numbers and letters for rows and colums

Iteration 2: Board cells method

This should create all 16 cells (4x4) that the board needs to run, in the form of a hash where each key is a coordinate and its value is a cell object for that coordinate

Setup

Make the file structure and readme for the repository

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.