Skip to main content

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
7 votes
1 answer
388 views

I'm new to code golf challenges. My problem came up in Advent of Code 2020 Day 8 The input is an array of arrays. In part two of the problem one needs to run several trials to produce a result by ...
Borislav Stanimirov's user avatar
5 votes
2 answers
463 views

Here is my ungolfed Ruby code for a function I want to try and golf: ...
Simply Beautiful Art's user avatar
7 votes
2 answers
295 views

I'm (still) trying to make another submission to the Largest Number Printable question, and I've got the following bit of code: ...
Simply Beautiful Art's user avatar
14 votes
3 answers
2k views

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?
Zawada's user avatar
  • 141
20 votes
11 answers
2k views

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 ...
Doorknob's user avatar
  • 72.1k
82 votes
53 answers
38k views

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 ...
grokus's user avatar
  • 1,307