/dragons

Dragons is a logic-based puzzle inspired by Battleship, Minesweeper and Conway's Game of Life.

Primary LanguageGoMIT LicenseMIT

Logo
Dragons

Build Status Code coverage

Introduction

Dragons is a logic-based puzzle inspired by Battleship, Minesweeper and Conway's Game of Life.

The objective is to fill a grid - some squares are given from the start. A square can either be a dragon (dragon), fire (fire) or air (air).

There are three rules that dictate how the grid must be completed. Only one valid solution exists for a given puzzle.

Rules

The territory rule

Every dragon has its own territory (the eight squares surrounding him). Inside one's territory there can't be other dragons. You can mark squares where dragons are impossible with a point (air).

illustration of the territory rule

The fire rule

Dragons don't like each other and they spit fire when being provoked. That's why squares of overlapping territories must always be fire - but only then.

illustration of the fight rule

The survive rule

Dragons need air to survive. That's why at least two of the four directly adjacent squares (not diagonal) of a dragon must be air.

illustration of the survive rule

Demo

Click here to try out the puzzle online. It also works on mobile phones.

Command line

This repository also contains a command line program that can generate and solve these kind of puzzles. The command line can be used as follows:

git clone https://github.com/winkula/dragons.git

go run .\cmd\dragons\