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

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Fizzbuzz in Complex Plane

4,354
views

Published on

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

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

Published in: Education

2 Comments
10 Likes
Statistics
Notes
No Downloads
Views
Total Views
4,354
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
1
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)