Guest User

full

a guest
Aug 24th, 2023
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.50 KB | None | 0 0
  1. {{ header }}
  2.  
  3. idxs = list(range(7))
  4.  
  5. # New.
  6. ctx = get_ctx()
  7. states = []
  8.  
  9. # Turn 0
  10. # Them: Got a triangle of 3 light grey dots by itself.
  11. def turn(state):
  12. # New question.
  13. results = set()
  14. orderedresults = []
  15. parents = []
  16. for config in getsets(idxs, 3):
  17. for x,y,z in permutations(config):
  18. check_xyz_triangle = is_triangle([x,y,z], ctx)
  19. check_xyz_light = all([is_light(dot, ctx) for dot in [x,y,z]])
  20. check_xyz_alone = all([not all_close([x,y,z,dot], ctx) for dot in idxs if dot not in [x,y,z]])
  21. if (
  22. check_xyz_triangle
  23. and check_xyz_light
  24. and check_xyz_alone
  25. ):
  26. dots = frozenset([x,y,z])
  27. if dots not in results:
  28. results.add(dots)
  29. orderedresults.append(dots)
  30. parents.append(config)
  31. return sort_state(orderedresults, parents, ctx, select=False)
  32. state = None
  33. states.append(turn(state))
  34. # End.
  35.  
  36. # Turn 1
  37. # You: Could be. One on right is largest with a tiny gray on top??
  38. def turn(state):
  39. # Follow up question.
  40. results = set()
  41. orderedresults = []
  42. parents = []
  43. for config in state:
  44. for a,b,c in permutations(config):
  45. check_a_right = a == get_right([a,b,c], ctx)
  46. check_a_largest = a == largest([a,b,c], ctx)
  47. check_b_tiny = is_small(b, ctx)
  48. check_b_grey = is_grey(b, ctx)
  49. check_b_top = b == get_top([a,b,c], ctx)
  50. if (
  51. check_a_right
  52. and check_a_largest
  53. and check_b_tiny
  54. and check_b_grey
  55. and check_b_top
  56. ):
  57. dots = frozenset([a,b,c])
  58. if dots not in results:
  59. results.add(dots)
  60. orderedresults.append(dots)
  61. parents.append(config)
  62. return sort_state(orderedresults, parents, ctx, select=False)
  63. state = states[0]
  64. states.append(turn(state))
  65. # End.
  66.  
  67. # Turn 2
  68. # Them: Nevermind. Do you see a pair of dark dots? One with another above and to the right of it? Same size as well.
  69. def turn(state):
  70. # New question.
  71. results = set()
  72. orderedresults = []
  73. parents = []
  74. for config in getsets(idxs, 2):
  75. for x, y in permutations(config):
  76. check_xy_pair = all_close([x,y], ctx)
  77. check_xy_dark = is_dark(x, ctx) and is_dark(y, ctx)
  78. check_y_right_x = is_right(y, x, ctx)
  79. check_y_above_x = is_above(y, x, ctx)
  80. check_xy_same_size = same_size([x,y], ctx)
  81. if (
  82. check_xy_pair
  83. and check_xy_dark
  84. and check_y_right_x
  85. and check_y_above_x
  86. and check_xy_same_size
  87. ):
  88. dots = frozenset([x,y])
  89. if dots not in results:
  90. results.add(dots)
  91. orderedresults.append(dots)
  92. parents.append(config)
  93. return sort_state(orderedresults, parents, ctx, select=False)
  94. state = None
  95. states.append(turn(state))
  96. # End.
  97.  
  98. # Turn 3
  99. # You: No.
  100. def turn(state):
  101. # No op.
  102. return [None]
  103. state = None
  104. states.append(turn(state))
  105. # End.
  106.  
  107. # Turn 4
  108. # Them: What about a large medium grey dot near the center?
  109. def turn(state):
  110. # New question.
  111. results = set()
  112. orderedresults = []
  113. parents = []
  114. for config in getsets(idxs, 1):
  115. for x, in permutations(config):
  116. check_x_large = is_large(x, ctx)
  117. check_x_grey = is_grey(x, ctx)
  118. check_x_center = is_middle(x, None, ctx)
  119. if (
  120. check_x_large
  121. and check_x_grey
  122. and check_x_center
  123. ):
  124. dots = frozenset([x])
  125. if dots not in results:
  126. results.add(dots)
  127. orderedresults.append(dots)
  128. parents.append(config)
  129. return sort_state(orderedresults, parents, ctx, select=False)
  130. state = None
  131. states.append(turn(state))
  132. # End.
  133.  
  134. # Turn 5
  135. # You: Is there a smaller black one next to it?
  136. def turn(state):
  137. # Follow up question, new dot.
  138. results = set()
  139. orderedresults = []
  140. parents = []
  141. for config in state:
  142. for a, in permutations(config):
  143. for x, in get1idxs(idxs, exclude=[a]):
  144. check_x_smaller_a = is_smaller(x, a, ctx)
  145. check_x_dark = is_dark(x, ctx)
  146. check_x_next_to_a = all_close([a,x], ctx)
  147. if(
  148. check_x_smaller_a
  149. and check_x_dark
  150. and check_x_next_to_a
  151. ):
  152. dots = frozenset([a,x])
  153. if dots not in results:
  154. results.add(dots)
  155. orderedresults.append(dots)
  156. parents.append(config)
  157. return sort_state(orderedresults, parents, ctx, select=False)
  158. state = states[4]
  159. states.append(turn(state))
  160. # End.
  161.  
  162. # Turn 6
  163. # Them: No. Do you see three dots in a diagonal line, where the top left dot is light, middle dot is grey, and bottom right dot is dark?
  164. def turn(state):
  165. # New question.
  166. results = set()
  167. orderedresults = []
  168. parents = []
  169. for config in getsets(idxs, 3):
  170. for x,y,z in permutations(config):
  171. check_xyz_line = is_line([x,y,z], ctx)
  172. check_x_top_left = x == get_top_left([x, y, z], ctx)
  173. check_x_light = is_light(x, ctx)
  174. check_y_middle = is_middle(y, [x,y,z], ctx)
  175. check_y_grey = is_grey(y, ctx)
  176. check_z_bottom_right = z == get_bottom_right([x, y, z], ctx)
  177. check_z_dark = is_dark(z, ctx)
  178. if (
  179. check_xyz_line
  180. and check_x_top_left
  181. and check_x_light
  182. and check_y_middle
  183. and check_y_grey
  184. and check_z_bottom_right
  185. and check_z_dark
  186. ):
  187. dots = frozenset([x,y,z])
  188. if dots not in results:
  189. results.add(dots)
  190. orderedresults.append(dots)
  191. parents.append(config)
  192. return sort_state(orderedresults, parents, ctx, select=False)
  193. state = None
  194. states.append(turn(state))
  195. # End.
  196.  
  197. # Turn 7
  198. # You: Yes. Is the top one close to the middle darker one?
  199. def turn(state):
  200. # Follow up question.
  201. results = set()
  202. orderedresults = []
  203. parents = []
  204. for config in state:
  205. for a,b,c in permutations(config):
  206. check_a_top = a == get_top([a,b,c], ctx)
  207. check_b_middle = b == get_middle([a,b,c], ctx)
  208. check_ab_close = all_close([a, b], ctx)
  209. check_b_darker_a = is_darker(b, a, ctx)
  210. if (
  211. check_a_top
  212. and check_b_middle
  213. and check_ab_close
  214. and check_b_darker_a
  215. ):
  216. results.add(frozenset([a,b,c]))
  217. return sort_state(orderedresults, parents, ctx, select=False)
  218. state = states[6]
  219. states.append(turn(state))
  220. # End.
  221.  
  222. # Turn 8
  223. # Them: Yes. And the smallest is on the bottom right.
  224. def turn(state):
  225. # Follow up question.
  226. results = set()
  227. orderedresults = []
  228. parents = []
  229. for config in state:
  230. for a,b,c in permutations(config):
  231. check_a_smallest = a == smallest([a,b,c], ctx)
  232. check_a_bottom_right = a == get_bottom_right([a,b,c], ctx)
  233. if (
  234. check_a_smallest
  235. and check_a_bottom_right
  236. ):
  237. dots = frozenset([a,b,c])
  238. if dots not in results:
  239. results.add(dots)
  240. orderedresults.append(dots)
  241. parents.append(config)
  242. return sort_state(orderedresults, parents, ctx, select=False)
  243. state = states[7]
  244. states.append(turn(state))
  245. # End.
  246.  
  247. # Turn 9
  248. # You: Yes, let's select the large one. <selection>.
  249. def select(state):
  250. # Select a dot.
  251. results = set()
  252. orderedresults = []
  253. parents = []
  254. for config in state:
  255. for a,b,c in permutations(config):
  256. check_a_large = is_large(a, ctx)
  257. check_b_not_large = not is_large(b, ctx)
  258. check_c_not_large = not is_large(c, ctx)
  259. if (
  260. check_a_large
  261. and check_b_not_large
  262. and check_c_not_large
  263. ):
  264. dots = frozenset([a])
  265. if dots not in results:
  266. results.add(dots)
  267. orderedresults.append(dots)
  268. parents.append(config)
  269. return sort_state(orderedresults, parents, ctx, select=True)
  270. state = states[8]
  271. states.append(select(state))
  272. # End.
  273.  
  274. # New.
  275. ctx = get_ctx()
  276. states.append([])
  277.  
  278. # Turn 0
  279. # You: Do you see a large black dot on the bottom left?
  280. def turn(state):
  281. # New question.
  282. results = set()
  283. orderedresults = []
  284. parents = []
  285. for config in getsets(idxs, 1):
  286. for x, in permutations(config):
  287. check_x_large = is_large(x, ctx)
  288. check_x_dark = is_dark(x, ctx)
  289. check_x_below_left = is_below(x, None, ctx) and is_left(x, None, ctx)
  290. if (
  291. check_x_large
  292. and check_x_dark
  293. and check_x_below_left
  294. ):
  295. dots = frozenset([x])
  296. if dots not in results:
  297. results.add(dots)
  298. orderedresults.append(dots)
  299. parents.append(config)
  300. return sort_state(orderedresults, parents, ctx, select=False)
  301. state = None
  302. states.append(turn(state))
  303. # End.
  304.  
  305. # Turn 1
  306. # Them: I see a large black dot next to two smaller lighter dots. The two smaller ones are the same size and color. We have different views though.
  307. def turn(state):
  308. # New question.
  309. results = set()
  310. orderedresults = []
  311. parents = []
  312. for config in getsets(idxs, 3):
  313. for x,y,z in permutations(config):
  314. check_xyz_close = all_close([x,y,z], ctx)
  315. check_x_large = is_large(x, ctx)
  316. check_z_dark = is_dark(z, ctx)
  317. check_y_smaller_x = is_smaller(y, x, ctx)
  318. check_z_smaller_x = is_smaller(z, x, ctx)
  319. check_y_lighter_x = is_lighter(y, x, ctx)
  320. check_z_lighter_x = is_lighter(z, x, ctx)
  321. check_yz_same_size = same_size([y,z], ctx)
  322. check_yz_same_color = same_color([y,z], ctx)
  323. if (
  324. check_xyz_close
  325. and check_x_large
  326. and check_z_dark
  327. and check_y_smaller_x
  328. and check_z_smaller_x
  329. and check_y_lighter_x
  330. and check_z_lighter_x
  331. and check_yz_same_size
  332. and check_yz_same_color
  333. ):
  334. dots = frozenset([x,y,z])
  335. if dots not in results:
  336. results.add(dots)
  337. orderedresults.append(dots)
  338. parents.append(config)
  339. return sort_state(orderedresults, parents, ctx, select=False)
  340. state = None
  341. states.append(turn(state))
  342. # End.
  343.  
  344. # Turn 2
  345. # You: Select the largest one.
  346. def select(state):
  347. # Select a dot.
  348. results = set()
  349. orderedresults = []
  350. parents = []
  351. for config in state:
  352. for a,b,c in permutations(config):
  353. check_a_largest = a == get_largest([a,b,c], ctx)
  354. if (
  355. check_a_largest
  356. ):
  357. dots = frozenset([a])
  358. if dots not in results:
  359. results.add(dots)
  360. orderedresults.append(dots)
  361. parents.append(config)
  362. return sort_state(orderedresults, parents, ctx, select=True)
  363. state = states[1]
  364. states.append(select(state))
  365. # End.
  366.  
  367. # Turn 3
  368. # Them: Okay.
  369. def turn(state):
  370. # No op.
  371. return [None]
  372. state = None
  373. states.append(turn(state))
  374. # End.
  375.  
  376. # Turn 4
  377. # You: Okay. <selection>.
  378. def turn(state):
  379. # No op.
  380. return [None]
  381. state = None
  382. states.append(turn(state))
  383. # End.
  384.  
  385.  
  386. # New.
  387. ctx = get_ctx()
  388. states = []{% set ns = namespace(turn_num=-1) %}
  389. {% if past is defined and past|length > 0 %}{% for block in past %}{% set ns.turn_num = loop.index0 %}
  390. # Turn {{loop.index0}}
  391. # {{ block[0] }}
  392. {{ block[1] }}
  393. # End.
  394. {% endfor %}{% endif %}
  395. # Turn {{ ns.turn_num+1 }}
  396. # {{text}}
  397. def
  398.  
Advertisement
Add Comment
Please, Sign In to add comment