forked from makenowjust/quine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquine.li
64 lines (64 loc) · 1.81 KB
/
quine.li
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
Section Header
+ name := QUINE;
Section Public
- main <- (
+ s :STRING_CONSTANT;
s := "Section Header\n\
\ + name := QUINE;\n\
\Section Public\n\
\ - main <- (\n\
\ + s :STRING_CONSTANT;\n\
\ s := \"%\";\n\
\ 1.to (s.count) do { i:INTEGER;\n\
\ + c :CHARACTER;\n\
\ c := s.item i;\n\
\ (c.code == 37).if {\n\
\ 1.to (s.count) do {\n\
\ j :INTEGER;\n\
\ + d :CHARACTER;\n\
\ d := s.item j;\n\
\ d.code.when 34 then {\n\
\ 92.to_character.print;\n\
\ }.when 10 then {\n\
\ 92.to_character.print;\n\
\ 110.to_character.print;\n\
\ 92.to_character.print;\n\
\ };\n\
\ d.print;\n\
\ d.code.when 10 then {\n\
\ \" \".print;\n\
\ 92.to_character.print;\n\
\ };\n\
\ };\n\
\ } else {\n\
\ c.print;\n\
\ };\n\
\ };\n\
\ );\n\
\";
1.to (s.count) do { i:INTEGER;
+ c :CHARACTER;
c := s.item i;
(c.code == 37).if {
1.to (s.count) do {
j :INTEGER;
+ d :CHARACTER;
d := s.item j;
d.code.when 34 then {
92.to_character.print;
}.when 10 then {
92.to_character.print;
110.to_character.print;
92.to_character.print;
};
d.print;
d.code.when 10 then {
" ".print;
92.to_character.print;
};
};
} else {
c.print;
};
};
);