Giter Site home page Giter Site logo

battleship's Introduction

Battleship CLI

Battleship CLI
--------------

$  git clone https://github.com/cristianemoyano/battleship.git
$  cd battleship
$  pipenv install
$  python3 game/cli.py

INSTRUCTIONS
------------

1. First, write the players name using the 'p1' and 'p2' commands:

battleship> p1 <Name Player 1>      // e.g. p1 Cristian

battleship> p2 <Name Player 2>      // e.g. p2 Emmanuel

2. Second, starts the game using the 'start' command. This will initialize the boards for each player.

battleship> start

3. Then, each player have to place their ships using the 'place_ship_p1' and 'place_ship_p2':

battleship> place_ship_p1 <row> <col> <ship> <aligment>     // e.g. place_ship_p1 A 1 carrier H

battleship> place_ship_p2 <row> <col> <ship> <aligment>     // e.g. place_ship_p2 A 1 carrier H


Tips and Notes:

- Each board support a max. of 5 ships.
- Run 'ls ships' or 'ls s' to see all available ships.
- Run 'ls aligments' or 'ls a' to see all available aligments.
- Run 'ls rows' or 'ls r' to see all available rows.
- Run 'ls cols' or 'ls c' to see all available columns.

4. Then, run 'play' to start shootig!:

battleship> play


5. Finally, each player can start shooting at each other (Always start playing Player 1):

battleship> shoot <row> <col>       // e.g. shoot A 1


Tips:
- Run 'help shoot' to see the usage.

Tests

python3 -m unittest test_main.py

battleship's People

Contributors

cristianemoyano avatar

Watchers

 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.