GithubHelp home page GithubHelp logo

battleship's Introduction

Battleship

Description

This is a game of Battleship. There are two players. Each player places 5 ships on their board. Then, players take turns firing at each other's boards, resulting in a HIT or a MISS. Once a player has sunk all of the other player's ships, he or she has won. HAVE FUN!

New features and bug fixes

  • Game no longer crashes if given improperly formatted coordinates.
  • Local multiplayer!
  • Now clears the screen between player turns
  • Displays ships on the grid as they're placed
  • When placing ships, any input other than across no longer defaults to down.
  • Game now reports duplicated shots.

Objective

Sink all 5 of your opponent's ships.

Rules for placing ships

  • Place each ship across or down
  • Do not place a ship on spots that overlap with another ship.

Instructions on how to play

  • Before the game starts, each player will place their ships. [See above for rules for placing ships.]
  • On your turn, pick a target coordinate and submit its location by letter and number. For example, you could enter B5 or E10.
  • When you submit a coordinate, the game will tell you if you have a hit or a miss. A hit means that you have successfully hit an opponent's ship - while a miss means you have not.
  • When it is your turn, you will see two grids - the first is a grid representing all of your hits and misses. A hit is a "+" and a miss is a "-". The second shows the location and status of your own boats. "O" signifies an occupied spot, while "X" signifies a spot that is occupied and has been HIT.
  • You cannot fire and hit the same spot more than once.
  • Once you have hit all the coordinates of a ship, that ship is sunk.
  • Once you have sunk all of your opponent's ships, you have won the game.

Known Issues

  • If you place your ship outside of the bounds, the game will tell you that it overlaps another ship.
  • Scrolling up allows you to see the other player's board.
  • Computer player does not place ships

battleship's People

Contributors

ru-t avatar tylerrockwell avatar masonfmatthews avatar

Watchers

James Cloos avatar  avatar

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.