Let's Play Ruby Golf
summary
Demonstrates concrete Ruby shortcuts uncovered by playing code golf: using predefined argv globals like $ variables, the question-mark literal for single chars, splat and multiplication as a join trick, square-bracket substring checks as an include* replacement, unary operators for precedence, and String#bytes. Applies them to a Caesar cipher, shrinking an implementation from 248 to 64 characters (a 74.2% reduction, nearly the 75% goal), learns heavy regex use and documents sources like Anarchy Golf.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 2:27What is Ruby golf?
- 3:22Code comparison: clean vs golf
- 6:19Ruby golf techniques
- 12:51Refactoring a cipher
- 16:44Conclusion and Q&A








