-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathClambserd.yasm
73 lines (57 loc) · 1.16 KB
/
Clambserd.yasm
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
#import lib.yasm
#define in_a a
#define in_b b
#define in_c c
#define in_d d
#define input0 e
#define input1 f
#define input2 g
#define temp j
#define return k
#define check_single_char_fallthrough(tinput, test) {
temp=test;
test-=pop_char(tinput)
continue_if(test>0)
continue_if(test!=temp);
}
#define check_single_char_goto(tinput, test) {
temp=test;
test-=pop_char(tinput)
gotochecker+(test<0or test==temp)
}
#define initchk_single_char_goto(tinput, test, next_line) {
temp=test;
test-=pop_char(tinput)
gotochecker+(test==temp)*eval(next_line-checker)
}
#define check_line(input, test) {
check_single_char_fallthrough(input, test)
check_single_char_goto(input, test)
}
#define submit_line(input, test) {
ifinput<0and0>test then
goto:done++
end
goto:o+4
}
@init_a:
in_a=:a;
input0=:i
:o=0
@checker:
check_line(input0, a)
@submission:
submit_line(input0, a)
@init_b:
in_a=:b;
input0=:i
:o=1
initchk_single_char_goto(input0, a, init_c)
@init_c:
in_a=:c;
input0=:i
:o=2
initchk_single_char_goto(input0, a, init_d)
@init_d:
:o=3
goto:done++