Ad

Ads keep TypeGG alive and support the team.
Please enable ads or subscribe to
Subscribe
Best of Ruby Quiz (Pragmatic Programmers). Volume 1 by James Edward Gray
Best of Ruby Quiz (Pragmatic Programmers). Volume 1 by James Edward Gray
Best of Ruby Quiz (Pragmatic Programmers). Volume 1
by James Edward Gray
Code Cleaning I'm always very vocal about how Ruby Quiz isn't interested in golf and obfuscation. It's my own private fight for clean code. To be fair, though, you can really learn a lot from practices such as golf and obfuscation. It will teach you a surprising number of details about the inner workings of your language of choice. Here's my compromise. This challenge is to utterly clean some famous examples of compressed Ruby code. Refactor the code until it's as readable as possible, whatever that means to you. For those who faint at the sight of dense code, I offer an "easier" challenge. Try this code by Mauricio Fernandez: code_cleaning/wiki.cgi #!/usr/bin/ruby -rcgi H,B=%w' HomePage w7.cgi?n=%s' ;c=CGI.new' html4' ;n,d=c[' n' ]!=' ' ?c[' n' ]:H,c[' d' ];t=`cat #{n}`;d!=' ' &&`echo #{t=CGI.escapeHTML(d)} >#{n}`;c.instance_eval{out{h1{n}+a(B%H){H}+pre{t.gsub(/([A-Z]\w+){2}/){a(B%$&){$&}}}+form("get"){textarea(' d' ){t}+hidden(' n' ,n)+submit}}} If you prefer a "trickier" challenge, I offer this famous code from Florian Gross. Just take a deep breath before turning the page....🏁
Submitted by *dash.png (@dasha) - 11/09/2025
Book Educational 11.97 Ranked

Global Leaderboard

# Player Time Duration Accuracy WPM pp
1
2
3
4
5
6
7
8
9
10