create account

RE: Introducing the Coding Challenge by reggaemuffin

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @reggaemuffin/introducing-the-coding-challenge

· @reggaemuffin · (edited)
$0.04
My ruby solution to FizzBuzz: https://repl.it/KNug/2
![](https://steemitimages.com/DQmPnwXYo6v2UYahrzvbKuKNfYWvTS8D1nimu9XCLXpD3oX/image.png)

I used the range iterator `(0..100).each` because it is really nice to read in my opinion.

Constants are important, but `FIZZBUZZ` depends on `FIZZ` and `BUZZ` so a dynamic constant is best there.

helper functions to test for the various cases  are really helpful for testing at. And the final fizzbuzz function reads like natural language.

The code works for negative values just fine and all functions are pure, so it can be used without printing anything.
👍  , , ,
properties (23)
authorreggaemuffin
permlinkre-reggaemuffin-introducing-the-coding-challenge-20170817t145007513z
categorycoding-challenge
json_metadata{"tags":["coding-challenge"],"image":["https://steemitimages.com/DQmPnwXYo6v2UYahrzvbKuKNfYWvTS8D1nimu9XCLXpD3oX/image.png"],"links":["https://repl.it/KNug/2"],"app":"steemit/0.1"}
created2017-08-17 14:50:09
last_update2017-08-17 14:50:36
depth1
children0
last_payout2017-08-24 14:50:09
cashout_time1969-12-31 23:59:59
total_payout_value0.031 HBD
curator_payout_value0.006 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length604
author_reputation37,964,839,695,531
root_title"Introducing the Coding Challenge"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id12,091,769
net_rshares10,733,352,661
author_curate_reward""
vote details (4)