create account

RE: Introducing the Coding Challenge by reggaemuffin

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

Viewing a response to: @bandli/re-reggaemuffin-introducing-the-coding-challenge-20170817t194047303z

· @reggaemuffin ·
I think your  result needs to be initialized, because on 5 your have `null + "Buzz"`. I'm not a c# person so I don't know if that implicitly works.

Kudos for test cases, that is worth a tip! I suggest you test a few negative numbers and multiples of 3 and 5, maybe `[-21, -25, -3, -15, 35, 33]`.

Maybe a c# person can chip in but I like this solution :)
properties (22)
authorreggaemuffin
permlinkre-bandli-re-reggaemuffin-introducing-the-coding-challenge-20170817t194717153z
categorycoding-challenge
json_metadata{"tags":["coding-challenge"],"app":"steemit/0.1"}
created2017-08-17 19:47:21
last_update2017-08-17 19:47:21
depth2
children2
last_payout2017-08-24 19:47:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length355
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,114,956
net_rshares0
@bandli ·
It works, I have test cases to prove it :) 

On a serious note, here's a quote from C# language specification:  **"If an operand of string concatenation is null, an empty string is substituted."** 

I also added tests for mentioned numbers and it seems to work fine (-21 returns "Fizz", 35 returns "Buzz", etc.).

Thanks for your feedback!
properties (22)
authorbandli
permlinkre-reggaemuffin-re-bandli-re-reggaemuffin-introducing-the-coding-challenge-20170817t200437680z
categorycoding-challenge
json_metadata{"tags":["coding-challenge"],"app":"steemit/0.1"}
created2017-08-17 20:04:36
last_update2017-08-17 20:04:36
depth3
children1
last_payout2017-08-24 20:04:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length339
author_reputation1,950,997,435
root_title"Introducing the Coding Challenge"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id12,116,163
net_rshares0
@reggaemuffin ·
Interesting, that is a pretty cool feature. Thank you for pulling out the specifications 😊
properties (22)
authorreggaemuffin
permlinkre-bandli-re-reggaemuffin-re-bandli-re-reggaemuffin-introducing-the-coding-challenge-20170818t052920379z
categorycoding-challenge
json_metadata{"tags":["coding-challenge"],"app":"steemit/0.1"}
created2017-08-18 05:29:21
last_update2017-08-18 05:29:21
depth4
children0
last_payout2017-08-25 05:29:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length90
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,147,376
net_rshares0