heroku login
heroku logout
| z,d = words = ["ズン","ドコ"] | |
| fin_words = [z,z,z,z,d] | |
| ans = [] | |
| while ans.join != fin_words.join | |
| ans = [] | |
| fin_words.length.times{ ans << fin_words.sample } | |
| end | |
| puts "#{ans.join}、キ・ヨ・シ!" |
| hasA, hasB, hasC = true, false, true | |
| cmd = ["foo"] | |
| cmd << "-a AAA" if hasA | |
| cmd << "-b BBB" if hasB | |
| cmd << "-c CCC" if hasC | |
| puts cmd.join(" ") |
勉強のためにrubyで言語処理100本ノックをなるべく答えを見ずにやってみる・・・!
そのため、記載してある回答は誤っている可能性がありますので、ご了承ください。
start:2017/04/12
言語処理100本ノック 2015
http://www.cl.ecei.tohoku.ac.jp/nlp100/
言語処理100本ノックは,実践的な課題に取り組みながら,プログラミング,データ分析,研究のスキルを楽しく習得することを目指した問題集です
| # 定数 | |
| HAND = ["p", "r", "s"] # r:グー、s:チョキ、p:パー | |
| class Player | |
| attr_accessor :id, :hand, :lose_flg, :rank | |
| def initialize(id) | |
| @id = id | |
| @hand = "" | |
| @lose_flg = false |
RubocopはOSSで開発されているソースコードの静的解析を行うgemです。
RubyStyleGuidにソースコードが準拠しているかチェックすることが出来ます。
Githubリポジトリ:https://github.com/bbatsov/rubocop