aboutsummaryrefslogtreecommitdiffstats
path: root/sample/trick2013/mame/entry.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-25 03:45:15 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-25 03:45:15 +0000
commite8052778c18eef07e5ef3403e234923ed5018333 (patch)
tree26b6031c117202b00f1b260df100e0e245e8f178 /sample/trick2013/mame/entry.rb
parent1e7a929c1d44d7a368fbe379211183ac6c972920 (diff)
downloadruby-e8052778c18eef07e5ef3403e234923ed5018333.tar.gz
* sample/trick2013/: added the award-winning entries of TRICK 2013.
See https://github.com/tric/trick2013 for the contest outline. (Matz has approved the attachment.) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/trick2013/mame/entry.rb')
-rw-r--r--sample/trick2013/mame/entry.rb97
1 files changed, 97 insertions, 0 deletions
diff --git a/sample/trick2013/mame/entry.rb b/sample/trick2013/mame/entry.rb
new file mode 100644
index 0000000000..cc88a959ef
--- /dev/null
+++ b/sample/trick2013/mame/entry.rb
@@ -0,0 +1,97 @@
+ eval$C=%q(at_exit{
+ open("/dev/dsp","wb"){|g|h=[0]*80
+ $><<"\s"*18+"eval$C=%q(#$C);S=%:"
+ (S<<m=58).lines{|l|s=[128]*n=20E2
+ t=0; h.map!{|v|d=?!==l[
+ t]?1 :(l[
+ t]== ?#)?
+ 0*v= 6:03
+ (v<1 ?[]:
+ 0..n -1).
+ each {|z|
+ s[z] +=2*
+ M.sin(($*[0] ||1)
+ .to_f*M.sin(y= 40*(z+m)*2**
+ (t/12E0)/463)+ y)*(v-z*d/n)};
+ t+=1;v-d};m+= n;g.flush<<(s.
+ pack"C*"); puts(l)}}};M=
+ Math);S=%:
+
+ Jesu, Joy of Man's Desiring
+ Johann Sebastian Bach
+
+ #
+ | #
+ | #
+ # # # #
+ | | | #
+ | | # #
+ # # # #
+ | | | #
+ | | # #
+ # # # #
+ | | | #
+ | | # #
+ # # # #
+ | | | #
+ | | # #
+ # # # #
+ | | | #
+ | | # #
+ # # # #
+ | | | #
+ | | # #
+ # # # #
+ | | | #
+ | | #
+ # # # #
+ | | | #
+ | #| #
+ # # | #
+ | | | #
+ | | # #
+ # # # #
+ | | # |
+ | | # #
+ # # # #
+ | | | #
+ | | #
+ # # # #
+ | | # |
+ | # # |
+ # # # #
+ | | | #
+ | | # #
+ # # # #
+ | | | #
+ | | # #
+ # # # #
+ | | | #
+ | | # #
+ # # # #
+ | | | #
+ | | # #
+ # # # #
+ | | | #
+ | | # #
+ # # # #
+ | | | #
+ | | # #
+ # # # #
+ | | | #
+ | # #
+ # # #
+ | | | #
+ | # | #
+ # # # #
+ | | | |
+ | | | |
+ | | | |
+ | | | |
+ | | | |
+ | | | |
+ | | | |
+ | | | |
+ | | | |
+ | | | |
+ | | | :