Hatena::Groupfizzbuzz

ebanの日記 RSSフィード

2010-03-28 (Sun)

GNU bc 22:47

for(;f=++i<101;) {
  if(!i%3){"Fizz";f=0}
  if(!i%5){"Buzz";f=0}
  if(f)i else"
"
}

2010-03-14 (Sun)

%を使わずにRuby16:51

(1..100).zip([p,p,:Fizz]*100, [p,p,p,p,:Buzz]*100) do |i, *a|
  puts a.join.max || i
end

2010-03-13 (Sat)

seqとGNU sed19:10

seq 100|sed '5~5s/.*/Buzz/;3~3s/[0-9]*/Fizz/'