File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## quine.wybe
2
+ #
3
+ # A Quine
4
+ ?listing = [
5
+ "## quine.wybe",
6
+ "#",
7
+ "# A Quine",
8
+ "?listing = [",
9
+ "]",
10
+ "?lines = listing^length",
11
+ "for _ in 0..4; ?line in listing {",
12
+ " !println line",
13
+ "}",
14
+ "for ?index in 0..lines; ?line in listing {",
15
+ " ?quote = 34:char",
16
+ " !print quote; !print line; !print quote",
17
+ " if { index < lines - 1 ::",
18
+ " !println ','",
19
+ " | else ::",
20
+ " !nl",
21
+ " }",
22
+ "}",
23
+ "for ?i in 4..lines {",
24
+ " if { ?line = listing[i] ::",
25
+ " !println(line)",
26
+ " }",
27
+ "}"
28
+ ]
29
+ ?lines = listing^length
30
+ for _ in 0..4; ?line in listing {
31
+ !println line
32
+ }
33
+ for ?index in 0..lines; ?line in listing {
34
+ ?quote = 34:char
35
+ !print quote; !print line; !print quote
36
+ if { index < lines - 1 ::
37
+ !println ','
38
+ | else ::
39
+ !nl
40
+ }
41
+ }
42
+ for ?i in 4..lines {
43
+ if { ?line = listing[i] ::
44
+ !println(line)
45
+ }
46
+ }
You can’t perform that action at this time.
0 commit comments