-
Notifications
You must be signed in to change notification settings - Fork 1
/
day20_tests.tal
107 lines (95 loc) · 2.57 KB
/
day20_tests.tal
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
~library/macros.tal
~library/devices.tal
( variables )
|0000
|0100 @program
T< "parse: >T
S<
"..#.#..#####.#.#.#.###.##.....###.# "#.#..###.####..#####..#....#..#..##..##
"#..######.###...####..#..#####..##. ".#.#####...##.#.#..#.##..#.#......#.###
".######.###.####...#.##.##..#..#..# "####.....#.#....###..#.##......#.....#.
".#..#..##..#...##.######.####.####. "#.#...#.......#..#.#.#...####.##.#.....
".#..#...##.#.##..#...##.#.##..###.# "......#.#.......#.#.#.####.###.##...#..
"...####.#..#..#.##.#....##..#.####. "...##...##..#...#......#.#.......#.....
"..##..####..#...#.#.#...##..#.#..## "#..#####........#..####......#..# 0a
0a
"#..#. 0a
"#.... 0a
"##..# 0a
"..#.. 0a
"..### 0a
>S ;make-get-byte JSR2 ;picture/parse JSR2
;picture/dump JSR2
( EXPECT 15 15 )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT .....#..#...... )
( EXPECT .....#......... )
( EXPECT .....##..#..... )
( EXPECT .......#....... )
( EXPECT .......###..... )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT ............... )
T< "enhance: >T
;picture/enhance JSR2
;picture/dump JSR2
( EXPECT 15 15 )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT .....##.##..... )
( EXPECT ....#..#.#..... )
( EXPECT ....##.#..#.... )
( EXPECT ....####..#.... )
( EXPECT .....#..##..... )
( EXPECT ......##..#.... )
( EXPECT .......#.#..... )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT ............... )
T< "enhance2: >T
;picture/enhance JSR2
;picture/dump JSR2
( EXPECT 15 15 )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT ..........#.... )
( EXPECT ....#..#.#..... )
( EXPECT ...#.#...###... )
( EXPECT ...#...##.#.... )
( EXPECT ...#.....#.#... )
( EXPECT ....#.#####.... )
( EXPECT .....#.#####... )
( EXPECT ......##.##.... )
( EXPECT .......###..... )
( EXPECT ............... )
( EXPECT ............... )
( EXPECT ............... )
T< "count: >T
;picture/count JSR2 DBGSHORTDEC POP2
( EXPECT 35 )
T< "👍 >T
BRK !
( s* -- get-byte )
@make-get-byte
;input STA2
;get-byte-from-input
RTN
( -- b )
@get-byte-from-input
[ ;input LDA2 ] LDA STH
[ ;input LDA2 ] INC2 [ ;input STA2 ]
STHr
RTN
@input $2
~library/test.tal
~day20_lib.tal