Good work on this! Your code works; it does exactly what the challenge asks for. And your methods all have a single responsibility and are easy to read. Some notes on details:
-
Because the given runner file is calling puts on the return value from your board_visualization method, you do not need to have any
puts
in that method. Right now you do, but you could refactor those two lines like this:player_a_string + "\n" + player_b_string
-
Heads up: Your winner method is written in such a way that, if both players reach 30 on the same turn, and player B actually ends up ahead of player A after that turn (for example, player A goes from 25 to 30, but on the same turn player B goes from 29 to 35), your method will declare player A the winner. Just making sure you are aware of this potential edge case and that this is what you want your code to do. (It is cool for your code to do this, since technically player A is reaching 30 first, but that is because player A goes first on each turn, which you may find unfair and thus not have wanted to happen.)
Keep it up!
-Phil