Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Fizzbuzz in Complex Plane

5,463 views

Published on

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

Published in: Education

Fizzbuzz in Complex Plane

  1. 1. FizzBuzz in Complex Plane Kaoru Maeda @mad_p Feb. 2013
  2. 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)

×