Skip to content

Conversation

hectorvs
Copy link

Hey Jesse, sorry for the delay, finally started working on the assignments.

Everything went... smoothly, I guess.

Just had some comments on assignment two, I had to modify some of the internal structure of the instance variables of game, so I used some sort of hack to do it.

How do you recommend doing this?

At first I tried game.player_hand = Hand.new but it didn't let me because there's not an accessor. However, it made sense not to have it, so I decided against it. The player shouldn't be able to modify it on the fly, right?

Thanks!

…d was the best way, the test knows too much about the implementation of the code, which makes it brittle... which way would you recommend for this?
… game itself, and the way of showing hidden cards is in the hand. that made most sense to me.
Copy link
Member

Choose a reason for hiding this comment

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

here you're overriding the attr_reader :suit. I think most developers would expect the "suit" method to return the actual suit, so I'd probably go with another method.

In the Eagle, I typically recommend that instead of using suit as a symbol, you go ahead and make the suit a full class. There you'd set your own to_s method.

@jwo
Copy link
Member

jwo commented Mar 12, 2013

Most excellent job on this! I added one comment that you saw, but other than that I think it's spot on.

regarding the player.hand = Hand.new --- I'm not sure? I'm cool with it, but would generally think that would be the dealer or game giving the player a new hand somehow.

let me know if you have questions on moving the suit to its own class!

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.

2 participants