Thanks to visit codestin.com
Credit goes to github.com

Skip to content

n0rz/Battleship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Battleship

Battle ship test task


Preferably develop following task in PHP. Make sure code is posted in github or bitbucket public repo.

  1. UI implementation is not important. Use the simplest and the easiest way you can. It will not play any role in evaluation, apart from evaluating your general ability to implement a front-end part it needed.

  2. Focus of this assignment is server side logic implementation - logic implementation on server side plays a crucial role in evaluation.

  3. Let's create an on-screen grid of cells aligned within a square 10 by 10.

  4. Then we set up initial battle ships - one L shaped, one I shaped and two dot shaped. Initial battle ships cannot overlap.

  5. Start actual game play after any kind of user input which would simulate shots at random positions - any missed shot would indicate already hit area, any shot at any of initial ships would visually indicate that battle ship has sink (change of ship color would be fine enough).

  6. Program must be able to tell that all ships have sunk and game is over.

  7. Battle ships must not touch one another so there is at least a single cell between them. Any battle ship rotation must be random.

  8. Multi cell battle ships (I && L) must consist of 4 cells, so there is no ambiguity of L shapes that do not look like L and I shapes of more or less than 4 cells.

Good luck!

To install/use:

Place it anywhere on your server.

Run composer install

Done!

About

Battleship Game For Interview

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages