2
FizzBuzz in Complex Plane Kaoru Maeda @mad_p Feb. 2013

Fizzbuzz in Complex Plane

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Fizzbuzz in Complex Plane

FizzBuzz in Complex Plane

Kaoru Maeda@mad_pFeb. 2013

Page 2: Fizzbuzz in Complex Plane

My answer (77 chars):puts eval($*.join'..').map{|n|%W[FizzBuzz Buzz #{n} Fizz][((n%3).i-n%5).arg]}

FizzBuzz Code Golf in Ruby (Tokyo Ruby Kaigi 10*)

1,2,3 radians

Buzz

FizzBuzz(Luckily, 0.arg == 0 in Ruby)

Select Fizz, Buzz, FizzBuzz, or Number by

5

6

17

2

3

8

9

4

Fizz0

10

11

12

13

14

* http://codeiq.hatenablog.com/entry/2013/01/16/002033