-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WorldOfDarkness: fix. add STA for 20th Ed. #137
Conversation
Codecov Report
@@ Coverage Diff @@
## master #137 +/- ##
=======================================
Coverage 86.30% 86.30%
=======================================
Files 192 192
Lines 22263 22266 +3
=======================================
+ Hits 19214 19217 +3
Misses 3049 3049
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
寄稿ありがとうございます。1点だけ修正お願いします。
src/diceBot/WorldOfDarkness.rb
Outdated
dice = Array.new(dice_pool) | ||
|
||
diceResults[i] = dice_now | ||
# FIXME: まとめて振る | ||
dice_pool.times do |i| | ||
dice_now, = roll(1, 10) | ||
dice[i] = dice_now | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Array.new
にブロックを渡すと、配列のサイズ分ブロックを実行し、戻り値を配列の要素にしてくれます
Array.new(2) { |i| i*2 } #=> [0,2]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* WorldOfDarkness: fix. add STA for 20th Ed. * WorldOfDarkness: allow diff=2 * WorldOfDarkness: refactor * WorldOfDarkness: refactor * WorldOfDarkness: fix * Remove unused block variable Co-authored-by: SAKATA Sinji <[email protected]>
原作者による2018-11-25版のtest caseを基に書き換えました。