Conversation
Notices
-
k5x (kpherox@pl.kpherox.dev@pl.kpherox.dev)'s status on Thursday, 17-Oct-2019 23:15:45 JST k5x 唐突にFizzBuzz書いてみたくなってzshで書いた -
k5x (kpherox@pl.kpherox.dev@pl.kpherox.dev)'s status on Thursday, 17-Oct-2019 23:17:23 JST k5x #!/bin/zshfor i in {1..30}; do FIZZ_BUZZ_FLG=0 if [ $(($i % 3)) -eq 0 ]; then FIZZ_BUZZ_FLG=1 echo -n 'Fizz' fi if [ $(($i % 5)) -eq 0 ]; then FIZZ_BUZZ_FLG=1 echo -n 'Buzz' fi if [ $FIZZ_BUZZ_FLG -eq 0 ]; then echo -n $i fi echo -ne '\n'done
-
k5x (kpherox@pl.kpherox.dev@pl.kpherox.dev)'s status on Thursday, 17-Oct-2019 23:18:44 JST k5x echo -nにしたら15の倍数か考えなくていいじゃんとか思ってたけどフラグ変数用意してるしだせぇ
-