Skip to content

Commit

Permalink
experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
mame committed Oct 7, 2017
1 parent 81d88ad commit 9c76d00
Show file tree
Hide file tree
Showing 6 changed files with 261 additions and 260 deletions.
96 changes: 48 additions & 48 deletions QR.rb

Large diffs are not rendered by default.

200 changes: 100 additions & 100 deletions SHA1SUMS
Original file line number Diff line number Diff line change
@@ -1,100 +1,100 @@
e1ba1ce8a3883e579ed420ba85cb73ec5fc36b1d *QR.rb
239093f52be44b09ae728ee87bec530a3acddfb5 *QR.scala
df78b9fab43b88cd1db27d984a6ad7d96700117d *QR.scm
8618106996a875947d3a1e2ccbab8100d00a0529 *QR.sci
d30258939fc0fb7ad77f4ea6ded12c84877b1a38 *QR.bash
26aa918acedc5b81fb8ded2945b35a4273c66934 *QR.sl
d841bd483261575db34ebbeb7dcdccb3b313d1b7 *QR.st
15d5deec5f7f5d52464f196233c6b586a4a87d35 *QR.nut
d351ef49261c927c354cbfeecf0ab6d0d9eccd34 *QR.sml
b8ee710217aef270f536fc2d3d50b899c3c8e9f5 *QR.sq
cd28bee1917059a68cba70edfb9d57a42a2e8014 *QR.tcl
e8d1b2ca7d83942ee99f5f568e5f366dc79aa010 *QR.t
a3d0a132f54953bcf7afcc285df0ba1f5411169c *QR.unl
0aaf28eb303453ad7155c233555fe0ba72ed3853 *QR.vala
c9ba65c418faa6c278abbe2eb1b2e62e1d2ae40d *QR.v
386ecdecdf04a987028eb9f0e827644660d2bb7b *QR.vb
cb61f424b7af6de6e3465817ffbcdb7ca3c4b504 *QR.ws
aa9730aed5fd5936fab4fe91ea9cdf5be99ba15f *QR.xslt
dfbe3c2a6e64f00489448d379e67d50fd902004e *QR.yorick
63e7b1dc6aaa6e4e857325ac950c5b17806e0c3f *QR.azm
ce61244d22bbcf2157fb257fbefd0e6710de556a *QR.+
3e9af8d7ff4006144792225dfacf5213800b7fc6 *qr.adb
d86554da9ca77dcf87384a007054e3888d0d6231 *QR.als
a88ba173eeae0399e9277611920dd9807f20242f *QR.a68
565f073804a6da5f50ccba1d760298a0918fe5cd *QR.ante
797f78a6d8be42c1d7753c1279afc61b40bdd743 *QR.asy
51aee2ac0f9eaa3674fc7ff5401ab6395e31f00d *QR.dats
cc3b516bc20244d7ed7d73857732058d9ee19363 *QR.awk
184305f22f7cbd532c6a5ad695ef10b9a2b02f43 *QR.bc
44d4dfe5ae5704e8acd3d4d295ea08872d75b20f *QR.bef
3ca2838936fdc668c86460cc51f13e5d08b8f7fc *QR.Blc
a032a840fbfa298f443735f80f350bcce10ef9b9 *QR.bf
16260e77fd674c129e48c8d49b33285e848bda62 *QR.c
60ff4cad54474c5688b7bac1f7c3d9054219e460 *QR.cpp
d7ac8c372568302d3e550f7a17000aaafef606c7 *QR.cs
4ef2210e6948b18dd26a136513f5c402ec7569eb *QR.chef
8df27de10f55fa34ac0105b91b8adb92f8649680 *QR.clj
495ce5c3c60c10871c5be601c09526c730334e04 *QR.cob
e2daa7f347585c1abd37fc616e94aae9442511cb *QR.coffee
c8eaf02ac9f4cc09713f6d18cd88b7d618d21a86 *QR.lisp
838be94876d8c55d2c7f84ebe532bfc96a3bc622 *QR.d
11df7df79238813cf816a6d4e59eff738d3d24b2 *QR.dfy
bf9de087b8a215f1af358716959c9c9701ccf2d2 *QR.dc
716f56934195f7a6dca954cc9e568ab979895bec *QR.ec
43662befce43dcaca0fd2d4bc90152beeaa219fa *QR.exs
ebe8913b66129afed1b617356fa80a003c873a38 *QR.el
7acdd4f3e251c12d9b4c2e46d64a7c3710765a59 *QR.erl
83f7abb27aaa42d93d3b8f864a8f7fdcb01004ae *QR.fsx
bf90656b5bd0005a03a5b51656a4f2abdc2be80f *QR.false
eb26dccab94581343c94889244b56e82b0003710 *QR.fs
0bf5d741e9bc0524ee140efc04e13704e1073fac *QR.f
af1721b4149de046f87b3c042fc6e0469d0f16b0 *QR.f90
eb8d948c27d0290deff210bd5b4fc28ac5481fc4 *QR.gbs
8b7cab6b60854f8b270b4d60e3dcf02d78a9a4e8 *QR.g
42d35bf42ab5c0b83791767ea00693d187845a3e *QR.gel
cbfefd00b71b1c8fcc7268968f36c6c7e8c86d36 *QR.plt
423b41783c40e975582af1e742c23dc0512bfe1e *QR.go
73af289245247599c18a19a64bf53305c77aa549 *QR.gpt
fa8e614049007ce42036d0639368dac84b2345ca *QR.grass
b963c437f7e446f3b096e6f3c9a71afde33206b1 *QR.groovy
6aa49fb48f2b0c45302c6ca1882c794d94903f51 *QR.hs
efc54aaebaee44527511fe2a640379619ef7f223 *QR.hx
9060ad581650005837d534be9646ff0fa0a00311 *QR.icn
141f7c6220a86c375fb524d03ff52f23324238fd *QR.i
facaf5f64064578a062549d264ab2176ed4f5a76 *QR.j
2e4d6b79ead30f7903a9105c652c4d8aa0d437ed *QR.java
cf3dcf256ea63be7810c3303dbe6fbad449c7736 *QR.js
c1a79b8e679b14caa700f29af4badb0f3175e911 *QR.jq
f1b737eeda102d4506cf7e827d8dbdc857b5a8a1 *QR.jl
f50c6113ef04a81d05f9f4176d4f3987e10c4fad *QR.lazy
febb23fa723b80c139083248ef5bf5715b53c2da *qr.li
7732eb9922803a728938bcd3304b7b656a7d1063 *QR.ll
c8543795b1aad7e7669b015fbb959771f567363c *QR.lol
9c4a651ae26399e61e5dcd7e4cad628fe3e3dc26 *QR.lua
787242337c91f217326169612a10d7e184624a3d *QR.mk
196fcff1e5b992922854845eeda9cf464c2fb47e *QR.mac
cc9009f2a1db8412e73426d1ca4a57136515be8f *QR.mzn
a0d9c31b2dc4ba17724d88705e689f77f61a95e3 *QR.il
5c207e48a03947314c8fe121a3ba93b03a3566e1 *QR.asm
1c52c20fa0837dd473236e4b53c5d0c6fcc3a37e *QR.neko
77faa1584db316df107be986b60d4e6f032e8570 *QR.5c
254e9583931074ad2f1dccf8fcc3c09803c87139 *QR.nim
81aa3e3b07225b02cf6cd06fdb8fd9c2a96b52fb *QR.m
9b4911925b7789988658d5bb3c64409ecebc18a5 *QR.ml
ddc9b08a3f0566c8eeda4474a0771e43530fb4f6 *QR.octave
ba2f69ac48d47b994d41212c8de14983ff5e54e0 *QR.ook
04709fba47392d490380cff96e7062873f7094e3 *QR.gp
7435010e973c425064ec1371197bd9856048b6ea *QR.pas
e405971b990ee00f1d0b4fbf1cea6711f387d52f *QR.pl
c47679ba6ddc212b4c0578dea2b7d96711f1b615 *QR.php
faabee7fcc4d9fc6addf64ac80e7cd374cb30f62 *QR.png
58279026c4e5a0c8023d815d139adde8c5d95bde *QR.pike
c13214159796eb4b210693a31cf746df6012d2d4 *QR.ps
f197c0b274c1b8d6c3533bc1e53b3d0cad128467 *QR.ppt
64f4b57d981f53a406b85d772ba112a625df6449 *QR.prolog
a3f421366e707679fc8adba27bd4186b0f7de3b7 *QR.py
c50fa67558968a516382c88e80f2d6d3a58d42e0 *QR.R
3d7916484a1d130014c38fa76367e811c792928c *QR.ratfor
f42277ec7e122fff938611e64f516e14ec5acdf2 *QR.rexx
dc01da90b36903ec258fc1cd8fa6675bfebc913b *QR.rs
70efc6e5a82f334494c93d6cc99d592acfaa3a76 *QR.rb
efbf3846e2333e4619fab3ad5c2e8d5e12a8c242 *QR.scala
c4ba001188b597e732cc137ece73722b34fdac7a *QR.scm
adc27fb5cab942184c66adf5ab957c1ccb4a6fd3 *QR.sci
af3674a083fa4384c072fbb200897624f70e948b *QR.bash
7708f5dfc50d34c0a3a38c16dc71bf4b3db03582 *QR.sl
b213745cfcd3d406b1ec834ab2c5ddc4175b2818 *QR.st
3667e96448e1f4e4a6541e99d2c846fac98911b9 *QR.nut
d21900cfc20e368e205f00b90677abb55eb2500d *QR.sml
3ba4ef9af9876361f960cf89d4347416ebd34dff *QR.sq
d906d0f4470c34008302042b4c37bcb748b5cc3f *QR.tcl
83be0c0afaeec74fb7be07eb27163f23cdf64f54 *QR.t
875fd140e27cc42ca9565e994cc39072b5d48d47 *QR.unl
ec0ad9bb9218e735ba91bec6ba2f684c61a9dca0 *QR.vala
2f0f09240a5d8a080afc2df8c38127663a12c44c *QR.v
8b493fde49573ac345ba5f851c483c7fd05675e3 *QR.vb
b9c17423fb3904504b7d3ec5cfb911e411c07b30 *QR.ws
609d481625fcf24ba9d3b2ae526eb774a5fc34aa *QR.xslt
fab550db2e38c798b2d8898f412c2aee4e9ae50e *QR.yorick
0947ac850c1e6c8220fce36c1813648907fd0691 *QR.azm
18042b565a9ed03c0fdd7fc2e08e81e1c6f5680f *QR.+
8dde9ba9c070d426569ac3f0b2056b05155261be *qr.adb
85dfdc5accc7d364c8bc0f024c86ebd407939860 *QR.als
d08f3dd972813679dd31bda0c36fea8ae009f462 *QR.a68
0296a8ae9fc98ec9a5bf60dec833acbfe779ed9d *QR.ante
6d02eaaee16293d7169d3810b66a029d7f9302a7 *QR.asy
4d466f8ef9f8ba2ed12abcdde26aec45a9fe4885 *QR.dats
62d4e8842185ff6eb318e24f804a793ff84fda0d *QR.awk
90257e4b5305f731cf3bdb10054ac66eace3ed08 *QR.bc
35329500339c695d80b9c6c0e7ac1d1763c391f2 *QR.bef
931bbfd2423acd6c94dbb11e07f7071179b8cde4 *QR.Blc
245d17f327cb89497a8a3f3098795a3eec87b2d8 *QR.bf
5dc8e327ec64b9bd91aa0b2804587f684d12137f *QR.c
4a7992e1b38518d958acd5d194cacb578945a4de *QR.cpp
6f41a7be827dc6f2272efba7d75039d8434cc243 *QR.cs
ccbb852c6e35c90b7d540547bb0e2049f23de12c *QR.chef
fc6aede77ce44d41bdf1934798be0270b8ddcc2d *QR.clj
6750b352c419a5f331ef6f3b0a450d0d47e129ab *QR.cob
87eeb639bb45fc612c5f3ac3e03d789806bcca69 *QR.coffee
268acf0e8c38387b7d1b145085be4d8f6234c8ed *QR.lisp
45e663a63febbbad1c997ac57581b3df8f125bbf *QR.d
6d36fc697f7644a7522b48e5adf819ff9ab8bc17 *QR.dfy
47d1d1fa74ea47b10fac31460d2bb991666e0331 *QR.dc
be39fb0ebadbbcdc2e33963d5e612dc1aef10f90 *QR.ec
aa1ff302219cdeac407af8d0b10b3f90953edca6 *QR.exs
0f70912100342dc033b830ad5523bc1d3b8dd215 *QR.el
0bd256d5b50c68727357769f34624fdcc70cf54c *QR.erl
d175dcd6198e82e56576b97e8f3c50d51ad9521d *QR.fsx
08b5b38131f346bc672e5b6bb033720f43b5098c *QR.false
c55075b5da51407e3249bc3d0849681483116ce7 *QR.fs
44c89b9cd6c29d3412c4003f130064316e2f0ef5 *QR.f
41f41c8768c5c844b03da8b505647ff3b4b60a10 *QR.f90
3c31feacf97254a7eff70fa06bdbbcca086b1145 *QR.gbs
c801c2cd534cdd87022395c710049512bd303215 *QR.g
3c02eb62f93336c044c2280864e5f94c69a3b563 *QR.gel
90c6348fc019532dcbb4c421c126354c8df49080 *QR.plt
3d322c73005e26a2ffbd84b9d112713b96d0730b *QR.go
55273e8c84733ae80b2db25660b81350e75d7bdf *QR.gpt
c35d44a4f9bf46803704839121bc50b9d6f990e4 *QR.grass
c7e54006e3e4d44947dfeade2eda02039607b7a7 *QR.groovy
df72b053d2c8968b0e4aa2d19fb17e70daead69e *QR.hs
22f29ee2d44c1122fc5fabb6f2f7c66e0ffd3d90 *QR.hx
919cf0820376f20bf173d6ad0d43db2dedb2358d *QR.icn
49bf63b31d1ce461340921954fe2dfabdc5ae348 *QR.i
ae2fc4fb68f475b7ebd3a8bca5d251c70fa74657 *QR.j
4913c656be331c6dcedcc205ea7ad153c11b631a *QR.java
5a57aec61c2b09763480e199b3ccfa84394e28e7 *QR.js
479b03fbfc1248c02a78c58a19aa077468576ff0 *QR.jq
510c04a2b9fb8e3377728a049253fa943cb7b457 *QR.jl
00ee5049b2bc6fe3d2f9973fbbcf7019e623de01 *QR.lazy
80a6097d7a9a701cfbdee697f1677310073c0dca *qr.li
c062d659eb1f9da67fc8349d426dd3788b8e07b4 *QR.ll
1ceac589bf9b6cb640b3b4a7c68e3b4eddad47dd *QR.lol
b7baecce4c98308ec58abe51f3eb35d682d2f0ea *QR.lua
6505f2f71fb834526170db9beec886cf1dec07cf *QR.mk
0c91f8cd87d5059396c6b61a574d3f22e406355b *QR.mac
af922e825931471d4d3374e028f5015eab852279 *QR.mzn
00dfc1e603db726be2d909c066679fd840576403 *QR.il
026fd6d93f1f4a48f5152025ffb9c6a77cbca59c *QR.asm
2bd70d8b17dcbdc214e7c07241b1184567b34e6c *QR.neko
57cde360314953b91ddb64bf5e7eae6ae7401aeb *QR.5c
959e2a7f9ed0f1db5856c1f70d5b6025f8b1a1b1 *QR.nim
ddb5b0c2f01ea91a2c9055faa278b03604123a25 *QR.m
bb07513f66b241ec8908a292bd5ea0c73e27bb36 *QR.ml
b829a2a1f7fbd98e252981e3775a73b7de9b7630 *QR.octave
1f3476b2e3fcea981dd420c6ebdcbe3538e108b0 *QR.ook
3ecea3c1c7b84905776e62a51ee456e3db39cd87 *QR.gp
7f2ca360e1da8f27d165fe4c2ea5648da68cc168 *QR.pas
954124461e02727857773740b85db9dcb9a7b5ee *QR.pl
b940c9941a8bc7d90e7e7f86e7d726f7b71d6fc3 *QR.php
b1203db16132007ca43574a57e7df89131f229e0 *QR.png
1d8232fde757dd948fd06cd0a1e903f08cea3e0a *QR.pike
9e5cd4d412987cd9bff2a34ca24b1c4fb52def1f *QR.ps
43b1f5c24f42d8ee5156fc32aa905b2117b8e79e *QR.ppt
98f5068aaac44a619cbb05ee82edfb083e1dbe0a *QR.prolog
73a0b1f442d1a08c43d535df71e36d6a8e353d3c *QR.py
7120387fff859592ca59fefc28ce89a50afea584 *QR.R
23d68a696c979ec4177f1bfc93b928e62e6bd681 *QR.ratfor
b7a485607a2a660c94b2ec097daa757f58aadbf7 *QR.rexx
753d5bced21579a934e5d4163f1ed42386bde890 *QR.rs
17 changes: 8 additions & 9 deletions src/QR.rb.gen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,22 @@
END

$stderr.puts "size: #{ code.b.size }"
code.chop!

TEMPLATE = File.read("uroboros.txt")
width = TEMPLATE[/.*/].size
while TEMPLATE.count("#") - width < code.size
s = TEMPLATE.count("#")
line = TEMPLATE[/^#*$/]
TEMPLATE.replace((line + "\n" + TEMPLATE + line).gsub!(/^|$/, "######") + "\n")
width = TEMPLATE[/.*/].size
warn "overflow!: #{ s - width }->#{ TEMPLATE.count("#") - width }"
end
PADDING = "".ljust(width, "#_buffer_for_future_bug_fixes_")
COPYRIGHT =
" Quine Relay -- Copyright (c) 2013, 2014 Yusuke Endoh (@mametter), @hirekoke ".
center(width, "#")[0..-2]

code.chop!
size = code.size + COPYRIGHT.size + 10
while TEMPLATE.count("#") < size
s = TEMPLATE.count("#")
line = TEMPLATE[/^#*$/] + "\n"
TEMPLATE.replace(line + TEMPLATE + line)
TEMPLATE.gsub!(/^|$/, "####")
warn "overflow!: #{ s }->#{ TEMPLATE.count("#") }"
end
code = TEMPLATE.gsub(/#+/) { w = $&.size; code.slice!(0, w).ljust(w, PADDING) }.chomp
code[-1] = ")"

Expand Down
Loading

0 comments on commit 9c76d00

Please sign in to comment.