from solver import solve_level

levels = (
  ('T', '0'), # 1
  ('TTT∀', '0000'), # 4
  ('∀TT∀', '0110'), # 123
  ('T∀TT', '1011'), # 1234
  ## INTRODUCE ↕
  ('T↕TT↕T', '000000'), # 25
  ('T↕TT∀T', '111001'), # 256
  ('∀↕↕T', '1001'), #34
  ('T↕↕↕T', '10001'), # 3
  ('↕∀↕T∀', '10100'), # 1234
  ('T↕TT∀T', '010101'), # 123456
  # INTRODUCE C
  ('TCT', '000'), # 2
  ('∀↕CT', '0101'), # 34
  ('∀↕↕C↕', '10011'), # 14
  ('↕C∀∀C∀↕', '1000111'), # 12357
  ('TT↕∀∀C↕', '0011011'), # 2347
  ('↕↕∀↕↕∀', '000110'), # 145
  # INTRODUCE ⇑
  ('TTT⇑T', '01000'), # 45
  ('↕↕↕⇑C∀', '010000'), # 54
  ('∀⇑⇑∀', '1000'), # 122
  ('⇑⇑∀⇑∀T', '001001'), # 3446
  ('∀⇑CT↕∀', '001010'), # 123245
  ('↕⇑∀C↕T', '000011'), # 134256
  # INTRODUCE %
  ("%C%T", "1000"), # 32 (2)
  (r"↕%%", "101"), # 121 (3)
  ("%CT%T", "01000"), # 21235 (5)
  ("∀%TTC%", "000001"), # 1565 (4)
  ("↕%∀%T", "00011"), # 13415 (5)
  (r"↕∀C%%", "11001"), # 12353 (5)
  (r"%%↕↕↕", "00011"), # 31345 (5)
  (r"%%%↕T", "00110"), # 14345 (5)
  ("%⇑%∀%", "10001"), # 11224 (5)
  ("T∀%CT%", "100011"), # 124564 (6)
  ("%⇑TT%", "01000"), # 23452 (5)
  # INTRODUCE N
  ('T↕↕N', '0010'), # 14
  ("TNT", "100"), # 132 (3)
  ('∀↕↕CTN', '001000'), # 1665
  ("∀CN", "001"), # 1313 (4)
  ("↕N↕", "101"), # 13213 (5)
  ("↕CNT", "0111"), # 4332 (4)
  ("%NT%", "1100"), # 13223 (5)
  ("↕N∀T", "0101"), # 134234 (6)
  (r"N⇑%%", "0100"), # 224121 (6)
  ("%N%∀∀", "00110"), # 142424212 (9)
  ("↕NT∀∀∀", "011010"), # 12323221342 (11)
  # NOPE ("∀∀N∀C∀", "010101"), # 153135315313535313 (18)
)

for index, (level, initial_state) in enumerate(levels):
  if len(level) != len(initial_state):
    raise Exception("State and level must have the same length")

  solution = solve_level(level, initial_state)
  print("%s %s %s Level solution: %s" % (str(index + 1).ljust(3), level.ljust(10), initial_state.ljust(10), solution))

from solver import solve_level

levels = (
  ('T', '0'), # 1
  ('TTT∀', '0000'), # 4
  ('∀TT∀', '0110'), # 123
  ('T∀TT', '1011'), # 1234
  ## INTRODUCE ↕
  ('T↕TT↕T', '000000'), # 25
  ('T↕TT∀T', '111001'), # 256
  ('∀↕↕T', '1001'), #34
  ('T↕↕↕T', '10001'), # 3
  ('↕∀↕T∀', '10100'), # 1234
  ('T↕TT∀T', '010101'), # 123456
  # INTRODUCE C
  ('TCT', '000'), # 2
  ('∀↕CT', '0101'), # 34
  ('∀↕↕C↕', '10011'), # 14
  ('↕C∀∀C∀↕', '1000111'), # 12357
  ('TT↕∀∀C↕', '0011011'), # 2347
  ('↕↕∀↕↕∀', '000110'), # 145
  # INTRODUCE ⇑
  ('TTT⇑T', '01000'), # 45
  ('↕↕↕⇑C∀', '010000'), # 54
  ('∀⇑⇑∀', '1000'), # 122
  ('⇑⇑∀⇑∀T', '001001'), # 3446
  ('∀⇑CT↕∀', '001010'), # 123245
  ('↕⇑∀C↕T', '000011'), # 134256
  # INTRODUCE %
  ("%C%T", "1000"), # 32 (2)
  (r"↕%%", "101"), # 121 (3)
  ("%CT%T", "01000"), # 21235 (5)
  ("∀%TTC%", "000001"), # 1565 (4)
  ("↕%∀%T", "00011"), # 13415 (5)
  (r"↕∀C%%", "11001"), # 12353 (5)
  (r"%%↕↕↕", "00011"), # 31345 (5)
  (r"%%%↕T", "00110"), # 14345 (5)
  ("%⇑%∀%", "10001"), # 11224 (5)
  ("T∀%CT%", "100011"), # 124564 (6)
  ("%⇑TT%", "01000"), # 23452 (5)
  # INTRODUCE N
  ('T↕↕N', '0010'), # 14
  ("TNT", "100"), # 132 (3)
  ('∀↕↕CTN', '001000'), # 1665
  ("∀CN", "001"), # 1313 (4)
  ("↕N↕", "101"), # 13213 (5)
  ("↕CNT", "0111"), # 4332 (4)
  ("%NT%", "1100"), # 13223 (5)
  ("↕N∀T", "0101"), # 134234 (6)
  (r"N⇑%%", "0100"), # 224121 (6)
  ("%N%∀∀", "00110"), # 142424212 (9)
  ("↕NT∀∀∀", "011010"), # 12323221342 (11)
  # NOPE ("∀∀N∀C∀", "010101"), # 153135315313535313 (18)
)

for index, (level, initial_state) in enumerate(levels):
  if len(level) != len(initial_state):
    raise Exception("State and level must have the same length")

  solution = solve_level(level, initial_state)
  print("%s %s %s Level solution: %s" % (str(index + 1).ljust(3), level.ljust(10), initial_state.ljust(10), solution))

# 1 # 4 # 123 # 1234 ## INTRODUCE ↕ # 25 # 256 #34 # 3 # 1234 # 123456 # INTRODUCE C # 2 # 34 # 14 # 12357 # 2347 # 145 # INTRODUCE ⇑ # 45 # 54 # 122 # 3446 # 123245 # 134256 # INTRODUCE % # 32 (2) # 121 (3) # 21235 (5) # 1565 (4) # 13415 (5) # 12353 (5) # 31345 (5) # 14345 (5) # 11224 (5) # 124564 (6) # 23452 (5) # INTRODUCE N # 14 # 132 (3) # 1665 # 1313 (4) # 13213 (5) # 4332 (4) # 13223 (5) # 134234 (6) # 224121 (6) # 142424212 (9) # 12323221342 (11) # NOPE ("∀∀N∀C∀", "010101"), # 153135315313535313 (18)