Fixed trashing bug, Lookout bug. Added Forager #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The trashing bug was this: say you included Trade Route on in trashPriority. Imagine you drew a hand with only one Trade Route in it and no other cards you wanted to trash. When the simulator called ai_playValue for Trade Route, ai_playValue would say, "Hey, there's a card in my hand I want to trash (Trade Route), so go ahead and play me." So the bot would play the Trade Route, but at that point there's nothing left in the bot's hand that it wants to trash: Trade Route was the only card in the hand that the bot wanted to trash. So the bot would be stuck trashing some other card it would have rather hung on to. I've pasted a simple bot that demonstrates the bug below.
I am new to Dominiate, Coffeescript, and GitHub, but I think I did everything right. However, I was unsure where to put the line
Array::remove = (e) -> @[t..t] = [] if (t = @indexOf(e)) > -1in basicAI.coffee, so I put it on top. Also, I decided to give Forager ai_playValue one below Upgrade, but am unsure of that as well.