Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

75%
+4 −0
Challenges 1, 2, Fizz, 4, Buzz!

goruby, 1 byte f Okay, so that's a bit unfair. 😂 The definition of f from golf_prelude.rb (which is what goruby embeds) is quite golfy in itself: def f(m = 100) 1.upto(m){|n|puts'FizzBuzz ...

posted 4y ago by C. K. Young‭  ·  edited 4y ago by C. K. Young‭

Answer
#2: Post edited by user avatar C. K. Young‭ · 2020-11-20T09:11:06Z (about 4 years ago)
Format the code blocks nicer.
  • ## goruby, 1 byte
  • ```
  • f
  • ```
  • Okay, so that's a bit unfair. 😂 The definition of `f` from `golf_prelude.rb` (which is what goruby embeds) is quite golfy in itself:
  • ```
  • def f(m = 100)
  • 1.upto(m){|n|puts'FizzBuzz
  • '[i=n**4%-15,i+13]||n}
  • end
  • ```
  • Substituting `m` with 100 directly gives us the Ruby version, which weighs in at 51 bytes:
  • ```
  • 1.upto(100){|n|puts'FizzBuzz
  • '[i=n**4%-15,i+13]||n}
  • ```
  • ## goruby, 1 byte
  • ```ruby
  • f
  • ```
  • Okay, so that's a bit unfair. 😂 The definition of `f` from `golf_prelude.rb` (which is what goruby embeds) is quite golfy in itself:
  • ```ruby
  • def f(m = 100)
  • 1.upto(m){|n|puts'FizzBuzz
  • '[i=n**4%-15,i+13]||n}
  • end
  • ```
  • Substituting `m` with 100 directly gives us the Ruby version, which weighs in at 51 bytes:
  • ```ruby
  • 1.upto(100){|n|puts'FizzBuzz
  • '[i=n**4%-15,i+13]||n}
  • ```
#1: Initial revision by user avatar C. K. Young‭ · 2020-11-20T09:09:40Z (about 4 years ago)
## goruby, 1 byte

```
f
```

Okay, so that's a bit unfair. 😂 The definition of `f` from `golf_prelude.rb` (which is what goruby embeds) is quite golfy in itself:

```
def f(m = 100)
  1.upto(m){|n|puts'FizzBuzz
'[i=n**4%-15,i+13]||n}
end
```

Substituting `m` with 100 directly gives us the Ruby version, which weighs in at 51 bytes:

```
1.upto(100){|n|puts'FizzBuzz
'[i=n**4%-15,i+13]||n}
```