Skip to content
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

Merged
merged 6 commits into from
Mar 17, 2020
Merged

WorldOfDarkness: fix. add STA for 20th Ed. #137

merged 6 commits into from
Mar 17, 2020

Conversation

opparco
Copy link
Contributor

@opparco opparco commented Mar 16, 2020

原作者による2018-11-25版のtest caseを基に書き換えました。

@codecov-io
Copy link

codecov-io commented Mar 17, 2020

Codecov Report

Merging #137 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #137   +/-   ##
=======================================
  Coverage   86.30%   86.30%           
=======================================
  Files         192      192           
  Lines       22263    22266    +3     
=======================================
+ Hits        19214    19217    +3     
  Misses       3049     3049           
Impacted Files Coverage Δ
src/diceBot/WorldOfDarkness.rb 98.46% <100.00%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d71424...d6a200f. Read the comment docs.

Copy link
Member

@ysakasin ysakasin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

寄稿ありがとうございます。1点だけ修正お願いします。

Comment on lines 91 to 97
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
Copy link
Member

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]

src/diceBot/WorldOfDarkness.rb Outdated Show resolved Hide resolved
Copy link
Member

@ysakasin ysakasin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ysakasin ysakasin merged commit 0de2911 into bcdice:master Mar 17, 2020
@opparco opparco deleted the fix-WorldOfDarkness branch March 17, 2020 15:49
ysakasin added a commit that referenced this pull request Aug 30, 2020
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants