Scala で FizzBuzz ショートコーディング
@lyrical_logical さんの素晴らしい資料からほぼ丸パクリ。
FizzBuzz golf in Scala - Google ドライブ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(i<-1 to'd')println(Seq("Fizz"*(1-i%3)+"Buzz"*(1-i%5),""+i)max) |
max を使う事で 1文字短縮でき、66 Bytes で書けた。
0 件のコメント:
コメントを投稿