summaryrefslogtreecommitdiff
path: root/sample/trick2013
diff options
context:
space:
mode:
Diffstat (limited to 'sample/trick2013')
-rw-r--r--sample/trick2013/README.md2
-rw-r--r--sample/trick2013/kinaba/remarks.markdown4
-rw-r--r--sample/trick2013/mame/music-box.mp4bin580724 -> 0 bytes
-rw-r--r--sample/trick2013/mame/remarks.markdown4
-rw-r--r--sample/trick2013/yhara/entry.rb2
5 files changed, 7 insertions, 5 deletions
diff --git a/sample/trick2013/README.md b/sample/trick2013/README.md
index 65f1d3b8ad..d6458c9d51 100644
--- a/sample/trick2013/README.md
+++ b/sample/trick2013/README.md
@@ -8,6 +8,8 @@ THESE ARE BAD EXAMPLES! You must NOT use them as a sample code.
* shinh/entry.rb: "Most Readable" - Silver award
* yhara/entry.rb: "Worst abuse of constants" - Dishonorable mention
+These files are licensed under MIT license.
+
For the contest outline and other winning entries, see:
https://github.com/tric/trick2013
diff --git a/sample/trick2013/kinaba/remarks.markdown b/sample/trick2013/kinaba/remarks.markdown
index a454a5f0a1..dcdce7e9ae 100644
--- a/sample/trick2013/kinaba/remarks.markdown
+++ b/sample/trick2013/kinaba/remarks.markdown
@@ -16,11 +16,11 @@ The program contains each ASCII character from 0x20 ' ' to 0x7e '~' exactly once
### Internals
-The algorthim is the obvious loop "32.upto(126){|x| putc x}".
+The algorithm is the obvious loop "32.upto(126){|x| putc x}".
It is not so hard to transform it to use each character *at most once*. The only slight difficulty comes from the constraint that we cannot "declare and then use" variables, because then the code will contain the variable name twice. This restriction is worked around by the $. global variable, the best friend of Ruby golfers.
-The relatively interesting part is to use all the charcters *at least once*. Of course, this is easily accomplished by putting everything into a comment (i.e., #unused...) or to a string literal (%(unused...), note that normal string literals are forbidden since they use quotation marks twice). Hey, but that's not fun at all! I tried to minimize the escapeway.
+The relatively interesting part is to use all the characters *at least once*. Of course, this is easily accomplished by putting everything into a comment (i.e., #unused...) or to a string literal (%(unused...), note that normal string literals are forbidden since they use quotation marks twice). Hey, but that's not fun at all! I tried to minimize the escapeway.
* "@THEqQUICKbBROWNfFXjJMPSvVLAZYDGgkyz". Trash box of unused alphabet. I wish I could have used "gkyz" somewhere else.
diff --git a/sample/trick2013/mame/music-box.mp4 b/sample/trick2013/mame/music-box.mp4
deleted file mode 100644
index 6d1e87c01c..0000000000
--- a/sample/trick2013/mame/music-box.mp4
+++ /dev/null
Binary files differ
diff --git a/sample/trick2013/mame/remarks.markdown b/sample/trick2013/mame/remarks.markdown
index 8c1988c809..488681d88d 100644
--- a/sample/trick2013/mame/remarks.markdown
+++ b/sample/trick2013/mame/remarks.markdown
@@ -27,7 +27,7 @@ In the piano roll, `#` represents a pin that hits a note, and `|` represents a s
The leftmost column corresponds 110Hz (low A).
Every column corresponds a semitone higher than the left one.
-This program uses [the frequency modulation synthesis](http://en.wikipedia.org/wiki/Frequency_modulation_synthesis) to play the sound like a music-box.
+This program uses [the frequency modulation synthesis](https://en.wikipedia.org/wiki/Frequency_modulation_synthesis) to play the sound like a music-box.
You can create a different-sounding tone by changing the parameter.
For example, the following will play the sound like a harpsichord.
@@ -44,4 +44,4 @@ You have to use sox by replacing the following part:
with:
- IO.popen("./pl","wb") \ No newline at end of file
+ IO.popen("./pl","wb")
diff --git a/sample/trick2013/yhara/entry.rb b/sample/trick2013/yhara/entry.rb
index a2deb54399..3666f271fa 100644
--- a/sample/trick2013/yhara/entry.rb
+++ b/sample/trick2013/yhara/entry.rb
@@ -2,7 +2,7 @@ def _(&b)$><<->(x){x ? (String===x ?x.upcase:
(Class===x ? x : x.class).name[$a?0:($a=5)]):
" "}[ begin b[];rescue Exception;$!;end ] end
-_ { return }
+_ { 1.tap }
_ { method(:p).unbind }
_ { eval "{ " }
_ { Thread.current.join }