LoginSignup
4
4

More than 5 years have passed since last update.

ฅ(・ω・ฅ) { ⏳ Ruby と figlet コマンドでカウントダウン ⏳ }

Last updated at Posted at 2015-02-15

:hourglass_flowing_sand: 概要

Ruby と figlet でカウントダウン

:raised_hand: 前提

figlet コマンドをインストール。大抵は標準的なパッケージ管理でインストールするだけです。

Ubuntu

$ apt-get install figlet

Cygwin

$ apt-cyg install figlet

サンプル

count_down.rb
second = ARGV[0] || 10
second = Integer(second)
second.times do
  system("clear")
  system("figlet #{Time.now.strftime("%H:%M:%S")}")
  sleep 1
end
system("clear")
system("figlet Finish")

試行

count_down.gif

:pencil: 補足

ฅ(・ω・)つシェル芸
という意見は残念ながら受け付けません

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4