Giter VIP home page Giter VIP logo

battleship's Introduction

Ruby - Battleship Game


About

In this project, I built the Battleship game by using ruby. The main goal is to put into practice the main concepts of Object Oriented Programming. Particularly, classes and access to their attributes.

  • If you want to play it online, visit this repl link to reach and play my Battleship game online.

How to start the game?

1- download this repository

2- unpack it (winrar recommended)

3- copy its address e.g.: c:\users\you\downloads\battleship

4- open your terminal commandline (powershell in my case)

5- write "cd" and put the address of the game folder

6- now, to run the game, type 'ruby ./lib/play_battleship.rb'

7- Have fun!

Rules

You probably already know how to play Battleship. If you do not know how to play it, please visit this link. It's a really simple game, right? That's what most people think. But if you really wrap your brain around it, you'll discover that the battleship isn't quite as simple as you think!

How to Play it...

  1. When you run the game, first enter a number to create a square grid as your board to play the game on.

  2. Then begin to enter positions with coordinates separated with a space like 4 7

  3. If you hit a ship, the N will become H, if you cannot hit, the N will become X.

  4. Try to hit all the hidden ships before you run out of the allowed attacks.


๐Ÿ”ง Built with

โœ’๏ธ Autor

๐Ÿ‘ค Safa ERDEN

๐Ÿค Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

๐Ÿ‘ Show your support

Give a โญ๏ธ if you like this project!

๐Ÿ“ License

This project is free to use as learning purposes. For any external content (e.g. logo, images, ...), please contact me.

battleship's People

Contributors

safaerden 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.