[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Fwd: Please Forward: Ruby Quiz Submission

James Gray

6/12/2007 2:51:00 AM

Begin forwarded message:

> From: James Koppel <darmaniiii@yahoo.com>
> Date: June 11, 2007 9:20:42 PM CDT
> To: submission@rubyquiz.com, submission@rubyquiz.com
> Subject: Please Forward: Ruby Quiz Submission
>
> The description and ASCII art perfectly explained the problem.
> Apparently, however, the photo has the sole purpose of being
> confusing by clashing with the description and the ASCII. After
> much pondering over how to interpret the description and get it to
> agree with the photo with no result, I just decided to ignore the
> photo (and the clause about the separator, which is apparently
> invisible on the ASCII...), and create this solution.
>
> str = "RBYBGYGGYGBYBR".scan(/../).inject("") { |s, cols|
> 1.upto(5) {|n|
> n2nd = s.length / 30 % 2 == 0 ? n : 6-n
> s << (cols[0,1]*(6-n2nd))+(cols[1,1]*n2nd)}
> s}
>
> 50.times {|n| puts str[n,50]}
>
> Take the Internet to Go: Yahoo!Go puts the Internet in your pocket:
> mail, news, photos & more.