Giter VIP home page Giter VIP logo

battleship-java's Introduction

Build status

Battleship Java

A simple game of Battleship, written in Java. The purpose of this repository is to serve as an entry point into coding exercises and it was especially created for scrum.orgs Applying Professional Scrum for Software Development course (www.scrum.org/apssd). The code in this repository is unfinished by design.

Getting started

This project requires a Java JDK 8 or higher. To prepare to work with it, pick one of these options:

Run locally

Run battleship with Gradle

./gradlew run --console plain

Execute tests with Gradle

./gradlew test

Docker

If you don't want to install anything Java-related on your system, you can run the game inside Docker instead.

Run a Docker Container from the Image

docker run -it -v ${PWD}:/battleship -w /battleship openjdk:15 bash

This will run a Docker container with your battleship case study mounted into it. The container will run in interactive mode and you can execute Gradle commands from the shell (see examples below).

If you are using Docker for Windows you might run into issues and get a message like

env: ‘sh\r’: No such file or directory

The reason for this is that Windows uses CRLF while Linux (in the Docker Container) uses only CR You can solve the issue by cloning the repository with a specific parameter:

git clone https://github.com/proscrumdev/battleship-java.git  --config core.autocrlf=input

Launching the game

./gradlew run --console plain

Running the Tests

./gradlew test

sample fleet placement

a1 a2 a3 a4 a5 a3 c2 c3 c4 c5 h2 h3 h4 h6 h7 h8 e2 e3

all shots

a1 a2 a3 a4 a5 a6 a7 a8 b1 b2 b3 b4 b5 b6 b7 b8 c1 c2 c3 c4 c5 c6 c7 c8 d1 d2 d3 d4 d5 d6 d7 d8 e1 e2 e3 e4 e5 e6 e7 e8 f1 f2 f3 f4 f5 f6 f7 f8 g1 g2 g3 g4 g5 g6 g7 g8 h1 h2 h3 h4 h5 h6 h7 h8

battleship-java's People

Contributors

michalkijas avatar jailforash avatar tschissler avatar p-goetz avatar garypedretti avatar mustaphazorgati avatar

Forkers

jailforash

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.