rspeer edited this page Nov 4, 2011 · 8 revisions
Clone this wiki locally

Dominiate is a strategy simulator for the card game Dominion. More information is at: http://rspeer.github.com/dominiate

Starting points


Random CoffeeScript development issues

These are issues that at least Rob has encountered. You might, too. So it's useful to list them here.

How do I track down a bug at the command line? It just says the error is in "Object" and the line numbers are all wrong.

The .coffee files are being temporarily compiled to .js, and the line numbers are right for the .js files. That, of course, doesn't help much when you can't see it. You can do this, though:

coffee -c buggyFile.coffee

Now you have buggyFile.js, and you can look at it and find the problem on the given line number. However, node.js will start importing this .js file in preference to the real .coffee file! So after this, you need to delete the file.

Am I going insane? No matter what I do to the code, nothing is changing.

You have a .js file sitting around, possibly because of the above, and it's being loaded instead of the .coffee file.

Why doesn't this "if" statement ever succeed?

CoffeeScript's syntax for conditionals looks a lot like Python, meaning you might be tempted to write something like: if not card in hand

Unfortunately, CoffeeScript has to stay true to its JavaScript roots, including operator precedence, so it's as if you wrote: if (!card) in hand

(!card) is false. false isn't in your hand. So add parentheses whenever you're in doubt: if not (card in hand)

Development goals

Finishing the cards is one thing, but we should also plan more about:

  • Endgame strategy - How can the simulator plan across multiple turns in the endgame to maximize its probability of winning?
  • Card values - Can we assign values to cards to indicate that Mountebanks are probably better than Woodcutters regardless of the strategy one plans to follow?
  • Custom cards - Can we streamline the card-creation process and make it accessible from the Web, so that people inventing their own cards can easily experiment with them?
  • Strategies with parameters - Can we try multiple variants of a strategy and find the best one, such as to find the best time to start buying Duchies?