Questions tagged [ruby]

This challenge is related to the Ruby language. Note that challenges that require the answers to be in a specific language are generally discouraged.

Filter by
Sorted by
Tagged with
67
votes
51answers
20k views

Tips for golfing in Ruby

What general tips can you give for golfing in Ruby? I'm looking for ideas that can be applied to code golf problems in general that are specific to Ruby. (For example, "Remove comments" would not be ...
18
votes
11answers
1k views

Crash IRB (interactive Ruby)

Ruby comes with a built-in REPL, which is quite handy. Your challenge is to crash it in the least amount of code! The definition of "crash" is "make it exit in an unintended way." This means ...
13
votes
3answers
950 views

Advice for ruby

How can I shorten: p=gets.to_i a=gets b=gets.to_i If my input is an integer, followed by a string, followed by an integer?
7
votes
2answers
187 views

How to improve Ruby code under some restrictions

I'm (still) trying to make another submission to the Largest Number Printable question, and I've got the following bit of code: ...
6
votes
2answers
338 views

Golf my iteration function

Here is my ungolfed Ruby code for a function I want to try and golf: ...