- Place all dominoes on the board so that all rules are satisfied.
A higher resolution is required to access the IDE
- 1
Learning Opportunities
This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.
Statement
The Goal
You are given a board with predefined cells where domino tiles must be placed. Some areas of the board come with special constraints (described in Rules section). Your task is to correctly place all given dominoes so that every condition is satisfied.
Rules
The board has a variable size and contains marked regions. Each marked region will be subject to one of the following constraints:
-
== : all cells must contain the same value. -
!= : all cells must contain unique values. -
> ruleValue: the sum of the cells must be greater than ruleValue. -
< ruleValue: the sum of the cells must be less than ruleValue. -
= ruleValue: the sum of the cells must be exactly ruleValue.
You will receive a board description, a set of rules to satisfy, and a set of unique domino pieces.
Each domino is rotated

- You fail to output a solution within the time limit.
- You do not place all the dominoes.
- You attempt to place a domino that does not exist or has already been placed.
- You provide an unrecognized orientation.
- You specify an invalid x,y combination (out-of-bounds or already occupied cell).
- Your final domino placement violates at least one rule.
Additional Info
- This puzzle is based on a logical game named Pips
- Source code on my GitHub
- Background image from Freepik.com
Game Input
Line 1: 2 space separated integers height and width of the board.
Next height lines: width space separated
integers = cell descriptions depicting the board (
Next line: single integer rulesCount
Next rulesCount lines: space separated ruleId, rule, ruleValue
-
1 ≤ ruleid ≤ rulesCount. - rule is
== ,!= ,> ,< or= . - ruleValue is a non-negative integer for
> ,< and= rules, and it is-1 for== and!= rules.
Next line: dominoesCount - the number of available dominoes.
Next dominoesCount lines: 2 space-separated integers a b as number of pips on current domino piece
dominoesCount lines: 5 space-separated integers
a b x y orientation (
- a and b are the number of pips on the two halves of a domino piece.
-
[x, y] is the position where the half with a is placed. - If orientation =
0 (horizontal), the half with b is placed at[x + 1, y] . - If orientation =
1 (vertical), the half with b is placed at[x, y + 1] .
Allotted response time to output solution is ≤
A higher resolution is required to access the IDE