Viewing a response to: @reggaemuffin/introducing-the-coding-challenge
My ruby solution to FizzBuzz: https://repl.it/KNug/2  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.
author | reggaemuffin |
---|---|
permlink | re-reggaemuffin-introducing-the-coding-challenge-20170817t145007513z |
category | coding-challenge |
json_metadata | {"tags":["coding-challenge"],"image":["https://steemitimages.com/DQmPnwXYo6v2UYahrzvbKuKNfYWvTS8D1nimu9XCLXpD3oX/image.png"],"links":["https://repl.it/KNug/2"],"app":"steemit/0.1"} |
created | 2017-08-17 14:50:09 |
last_update | 2017-08-17 14:50:36 |
depth | 1 |
children | 0 |
last_payout | 2017-08-24 14:50:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.031 HBD |
curator_payout_value | 0.006 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 604 |
author_reputation | 37,964,839,695,531 |
root_title | "Introducing the Coding Challenge" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 12,091,769 |
net_rshares | 10,733,352,661 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
benniebanana | 0 | 7,339,582,037 | 100% | ||
j4y | 0 | 2,640,018,812 | 100% | ||
codetechninja | 0 | 585,446,400 | 100% | ||
bankholiday | 0 | 168,305,412 | 100% |