Coder Social home page Coder Social logo

battleship's Introduction

Battleship

Battleship is a web-based game that simulates the classic board game of the same name. The objective of the game is to sink all the enemy ships before they sink yours.

Features

  • You can play against a computer opponent that randomly places and fires at ships.
  • You can see the status of your own ships and the enemy’s hits and misses on a grid.

Technologies

This project is made with JavaScript, HTML and CSS. It also uses the following tools and libraries:

  • Jest: A JavaScript testing framework that allows test-driven development.
  • Babel: A JavaScript compiler that transforms modern syntax into browser-compatible code.
  • Webpack: A module bundler that bundles JavaScript files and assets into a single file.

Installation

To install this project, you need to have Node.js and npm installed on your machine. Then follow these steps:

  • Clone this repository: git clone https://github.com/N3mEee/Battleship.git
  • Navigate to the project folder: cd Battleship
  • Install the dependencies: npm install
  • Run the tests: npm test
  • Build the project: npm run build
  • Open the index.html file in your browser.

Usage

To play the game, follow these steps:

  • Click on any cell on your grid to place a ship. You can rotate a ship by pressing R or clicking on it again. Work in Progress
  • When you are done placing your ships, click on Start Game.
  • Click on any cell on the enemy grid to fire at it. You will see a red cell if you hit a ship, or a gray cell if you miss.
  • The game ends when either you or the enemy sinks all the ships.

Acknowledgments

This project is inspired by The Odin Project, an online curriculum for learning web development.

battleship's People

Contributors

n3meee avatar

Stargazers

 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.