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

shell has trouble with some GCG games #75

Closed
domino14 opened this issue Jul 18, 2020 · 3 comments
Closed

shell has trouble with some GCG games #75

domino14 opened this issue Jul 18, 2020 · 3 comments

Comments

@domino14
Copy link
Owner

macondo> load gcgio/testdata/josh2.gcg

then

macondo> turn 21

then type in n and it screws up. Yet the tests for this GCG pass.

@ddugovic
Copy link
Collaborator

ddugovic commented Aug 18, 2022

Changing turn 21 in the GCG to play B3 VS for 5 points then challenging off VS does not produce this error. This error seems to only occur when challenged-off tiles do not appear multiple times in the bag (in this case, on move 21 the bag contains 2 V tiles).

I hand-crafted this GCG which causes Macondo to fail:

#player1 Player_1 Player 1
#player2 Player_2 Player 2
#lexicon NWL18
>Player_1: AAAAAQZ 8H QZ +40 40
>Player_1: AAAAAQZ --  -40 0

whereas the following does not fail:

#player1 Player_1 Player 1
#player2 Player_2 Player 2
#lexicon NWL18
>Player_1: AAAAAEE 8H EE +4 4
>Player_1: AAAAAEE --  -4 0

@ddugovic
Copy link
Collaborator

ddugovic commented Aug 18, 2022

Here is the off-by-one else logic error (that in the event of a successful challenge, the opponent's rack should be set to rack):

macondo/game/game.go

Lines 741 to 747 in 27627dd

} else {
// playTurn should have refilled the rack of the relevant player,
// who was on turn.
// So set the currently on turn's rack to whatever is in the history.
log.Trace().Int("turn", t).Msg("setting rack from turn")
err := g.SetRackFor(g.onturn, alphabet.RackFromString(
g.history.Events[t].Rack, g.alph))

@domino14
Copy link
Owner Author

thanks, this was fixed

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

No branches or pull requests

2 participants