Your SlideShare is downloading. ×
0
Fizzbuzz in Complex Plane
Fizzbuzz in Complex Plane
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Fizzbuzz in Complex Plane

4,458

Published on

複素数の偏角取ったらFizzBuzzがキレイに解けた記念に

複素数の偏角取ったらFizzBuzzがキレイに解けた記念に

Published in: Education
2 Comments
10 Likes
Statistics
Notes
No Downloads
Views
Total Views
4,458
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
2
Comments
2
Likes
10
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. FizzBuzz in Complex Plane Kaoru Maeda @mad_p Feb. 2013
  • 2. FizzBuzz Code Golf in Ruby (Tokyo Ruby Kaigi 10*) My answer (77 chars): puts eval($*.join'..').map{|n|%W[FizzBuzz Buzz #{n} Fizz][((n%3).i-n%5).arg]} Im Select Fizz, Buzz, FizzBuzz, or Number by êarg((nmod3)i - (nmod 5))ú ë û 14 8 2 Buzz 11 5 nmod3 4 13 7 1 10 Fizz 1,2,3 radians 9 3 12 -nmod5 * http://codeiq.hatenablog.com/entry/2013/01/16/002033 6 0 Re FizzBuzz (Luckily, 0.arg == 0 in Ruby)

×