-
Notifications
You must be signed in to change notification settings - Fork 0
/
galaxien.txt
64 lines (55 loc) · 1.45 KB
/
galaxien.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
galaxien (tentaisho)
http://www.janko.at/Raetsel/Galaxien/index.htm
Rules: Divide the diagram along the grid lines into regions. Each region must contain exactly one circle and must be point symmetric on this circle.
My interpretation
Rules:
A Divide the diagram along the grid lines into regions.
B Each region must contain exactly one circle
C and must be point symmetric on this circle.
constraints (circles) can be in a square, on the line between two squares, or on the point between four squares.
Constraint X Y
for points on lines, use .5
+ + +
o
+ + +
o is at 1 1
+ + +
o
+ + +
o is at 1.5 1
+ + +
+ 0 +
+ + +
o is at 1.5 1.5
regions must be circularly symmetric
regions must be connected
regions are sets of squares
Region Squares
symmetric(R = Region S, C = Constraint cx cy) =
\forall Q = Square x y \in S .
\exists Square x' y' \in S
where
dx = x - cx
x' = cx - dx
dy = y - cy
y' = cy - dy
connected(R = Region S) =
\/ \forall Q = Square x y \in S .
\/ \exists Square x+1 y \in S
\/ \exists Square x-1 y \in S
\/ \exists Square x y+1 \in S
\/ \exists Square x y-1 \in S
\/ |S| = 1
Solution :: [Region] => Solution
Solution Regions
solves(S = Solution Rs, B = Board W H Cs) =
/\ \forall R \in Rs .
/\ connected(R)
/\ \not \exists Ca, Cb \in Cs .
/\ Ca \in R
/\ Cb \in R
/\ \forall C \in Cs .
C \in R => symmetric(R,C)
/\ \forall Q \in Squares(W,H) .
\exists R \in Rs .
Q \in R