In [14]:
import forge
from puzzle.puzzlepedia import puzzlepedia
# On the subject of Fruit.
puzzle = puzzlepedia.parse("""
A = variable(1, 20, 'A')
K = variable(1, 20, 'K')
O = variable(3, 4, 'O')
P = variable(1, 20, 'P')
S = variable(1, 20, 'S')
T = variable(1, 20, 'T')
x = variable(1, 20, 'x')
y = variable(1, 20, 'y')
z = variable(1, 20, 'z')
# x Freya has 3 oranges.
O == 3
# If A's color mixed with B's color gives C's color, then the number of fruits that C has is equal to the number of fruits that A and B have together.
S + x == 3
A + x == y
A + S == z
S < O
for free in [x, y, z]:
free == K or free == P or free == T
# x Rachel has the fewest number of fruit, which are strawberries.
all(S < f for f in [A, K, O, P, T])
# x The red house grows apples. There are fewer apples than kiwis.
A < K
# x There are 24 fruits in all.
A + K + O + P + S + T == 24
# x There are double the number of pumpkins as oranges.
P == O * 2
# x Tomatoes are a fruit.
""".lower())
In [1]:
import forge
from puzzle.puzzlepedia import puzzlepedia
puzzle = puzzlepedia.parse("""
459601727585320977851323670
""")
In [ ]: