Skip to content

Implementation of the infamous game Sink The Float in Prolog. Played against the machine but the board is only visible for it.

License

Notifications You must be signed in to change notification settings

angeligareta/battleship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Battleship

Implementation of the infamous game Battleship or Sea Battle using the logic programming language Prolog

ULL License GitHub contributors

About

The aim of the game is to guess were the boat of the opponent is. We only implemented 1 boat that can have 1, 2 or 3 blocks of width, depending on the difficulty we choose.

Features

  • The board is square.
  • You can choose a size for the board. Maximum 9 columns.
  • You can choose a difficulty before starting the game.
  • Depending on the difficulty there will be more or less attempts and the size of the boat will vary.
  • In each round you can put an x/y position.
  • If the attempts finish and you haven't sunk the boat you loose.
  • To exit the game you can put 0 in a position.

Usage

To play the program it's necessary to have Prolog installed. After that we can execute the program following the syntax:

prolog src/sink_the_float.pl

After that we can start the game writing:

play.

First of all we have to choose the size of the board, followed by the desired difficulty. Finally it will show the number of rounds left to guess the opponent boat.

Screenshots

Starting the Game

Starting the Game

Game Finished - Win

Game Finished - Win

Game Finished - Loose

Game Finished - Loose

Authors

About

Implementation of the infamous game Sink The Float in Prolog. Played against the machine but the board is only visible for it.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages