File tree 1 file changed +17
-6
lines changed
1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -22,18 +22,29 @@ thousands of turns.]]
22
22
:setv a state.action
23
23
(ecase (type a)
24
24
Wait [" Wait" ]
25
- Walk [" Walk" a.direction.x a.direction.y]
26
- Shoot [" Shoot" a.direction.x a.direction.y]
27
- UseItem [" UseItem" a.item-ix a.target-x a.target-y])))))))
25
+ Walk [" Walk"
26
+ a.direction.x a.direction.y]
27
+ Shoot [" Shoot"
28
+ a.direction.x a.direction.y]
29
+ UseItem [" UseItem"
30
+ a.item-ix a.target-x a.target-y]
31
+ UseControllableTeleporter [" UseControllableTeleporter"
32
+ a.direction a.target-x a.target-y])))))))
28
33
29
34
(defn load [path]
35
+ (defn d [xs]
36
+ (get Direction.from-coords (tuple xs)))
37
+
30
38
(for [[atype #* args] (tqdm
31
39
(hy.I.json.loads (hy.I.gzip.decompress (.read-bytes (Path path)))))]
32
40
(take-turn (ecase atype
33
41
" Wait" (Wait )
34
- " Walk" (Walk (get Direction.from-coords (tuple args)))
35
- " Shoot" (Shoot (get Direction.from-coords (tuple args)))
36
- " UseItem" (UseItem #* args)))))
42
+ " Walk" (Walk (d args))
43
+ " Shoot" (Shoot (d args))
44
+ " UseItem" (UseItem #* args)
45
+ " UseControllableTeleporter" (UseControllableTeleporter
46
+ (d (get args 0 ))
47
+ #* (cut args 1 None ))))))
37
48
38
49
39
50
(defmain [_ action path]
You can’t perform that action at this time.
0 commit comments