Created
October 21, 2011 19:11
-
-
Save hagiyaki/1304664 to your computer and use it in GitHub Desktop.
おみくじしたくなった時用earthquake.gem plugin
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| # omikuji tweet / earthquake plugin | |
| # 浅草寺(東京) | |
| # e.g. :omikuji #=> おみくじ:[運勢] | |
| # | |
| Earthquake.init do | |
| command :omikuji do | |
| s = "おみくじ:" | |
| case rand(101) | |
| when 0 .. 17 | |
| s << "大吉" | |
| when 18 .. 53 | |
| s << "吉" | |
| when 54 .. 58 | |
| s << "小吉" | |
| when 59 .. 65 | |
| s << "末吉" | |
| when 66 .. 69 | |
| s << "末小吉" | |
| else | |
| s << "凶" | |
| end | |
| input("#{s}") | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment