Last active
December 10, 2015 18:48
-
-
Save asonas/4476547 to your computer and use it in GitHub Desktop.
リファクタリングお願いします。
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
# encoding: utf-8 | |
require "prime" | |
script = %w( | |
おちつけ.... | |
心を平静にして考えるんだ... | |
こんなときどうするか... | |
prime | |
落ち着くんだ | |
「素数」を数えて落ち着くんだ | |
) | |
script.each do |selif| | |
if selif == "prime" | |
Prime.take_while{ |n| n < 20 }.each do |n| | |
puts n | |
sleep 0.4 | |
end | |
else | |
p selif | |
end | |
sleep 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
リファクタリングと関係が無くて恐縮ですが。
zshを使っていて、焦って間違ったコマンドを打った時に、冷静になれるようにしました。
この関数を".zshrc"に追記したり、"notfound.zsh"に書いて
source notfound.zsh
する事で使えますー。天下のslコマンドと同じ匂いがします。