Giter Club home page Giter Club logo

battleship's Introduction

Welcome to Battleship!

Rules:

Sink the computer's ships before the computer sinks yours! Both you and the computer will place your ships to start the game, then the game begins! Each team will take one shot each round at the other team's board and will be informed whether the shot was a hit or a miss. A winner is crowned when the first player sinks both ships of the opposing player.

How to play:

  • Start the game by navigating to the Battleship directory in your terminal, entering "ruby runner.rb", then clicking the return key.

  • After the game has been initiated, you will first be asked to click "P" to play, or "Q" to quit. Please enter the your response exactly as prompted with either letter.

  • If "P" is entered, you will be asked to place your ships, starting with the cruiser. The cruiser is three cells long. To input your ship, please enter the three cells in which you wish for the cruiser to be placed, with exactly one space in between each. Examples; "A1 A2 A3" or "A1 B1 C1." The cells must be placed in exact order for the game to continue. Once you have selected the cells, hit the return key. You will then be prompted to enter your submarine. Please follow the same steps as above, but be aware the submarine is only two cells in length.

  • Once your ships are placed, you will be asked to take your first shot. Select a coordinate within the map, ranging anywhere from "A1" to "D4." Again, the coordinate must be entered exactly as the coordinate stands or you will be asked to re-enter.

  • The game will tell you whether you shot was a hit or a miss and will show you the current playing boards.

  • The game will end once both ships have been sunk on either team.

Good luck!

battleship's People

Contributors

mintona avatar will-d-m 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.