striglia / dominion_sim Goto Github PK
View Code? Open in Web Editor NEWA simulator for the card game Dominion
A simulator for the card game Dominion
Since some cards depend on the cards that have been played this turn, there needs to be an intermediate between hand and discard.
Implement a player which buys duchies, silver and copper (in that order). This should be beat by the Money player arbitrarily close to every game.
Implement player class which buys Provices, Gold and Silver (in that order). Should beat Moron essentially every game.
Add method which checks can_buy, debits the current treasure count and adds the chosen card to the discard pile. For now, force this to discard, although eventually this is a card-level method.
Buys provinces, duchies and even estates.
Current tests of Moron vs Money result in neither player ever buying! Likely an issue with calculation of buys or treasure, resulting in _can_buy(card) always returning False.
Write harness for repeatedly playing two players against each other. Should track stats per game. Would be cute to use multiprocessing to speed up games.
Currently game_test already checks empty provinces. Need to check that three_empty_stacks works.
All easy cards that, for now, only require checks on money to buy and can be quickly folded into existing Players for testing.
Track the VP at the end of each turn for each player. Return at end of every game for future analysis.
Add action helpers at deck and player level (like can_buy and buy_card).
Requires knowledge of size of current hand to play action
For a given deck, use treasure property and card cost to determine whether a card can be bought.
Test that Money wins >= 99 of 100 games. This conveniently stress tests the engine. For now, manually run 100 games in a loop. Later this will. E built out properly.
Easy enough just need to decide how best to start building out player logic for more complicated card plays that require deck knowledge.
These are really turn based, but should be able to calculate how many actions, buys and treasure is currently available.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.