views:

243

answers:

2

MVC 'architecture'. I would like a convenient way of specifying the rules of a card game including aspects such as hands or tricks, scoring, which cards from the deck or pack are used, and so on. Does anyone know of anything like this, preferably in Javascript?

Thanks for any guidance.

+1  A: 

There's a good article here (and as a complement I suggest the companion article about displaying playing cards with CSS that's here). Nothing much to do with Python though!-) If you do want an example of handling a card game (including showing the cards as images in Tkinter) with Python, try this one (which however has nothing to do with Javascript: not sure why you've tagged your question with both languages).

Alex Martelli
Thank you for responding!My question is cryptic because I'm struggling. I want to build a family of simple card games. A program is a form of knowledge representation (an ontology). So I could simply represent what I know about the card games as a Javascript or Python program. But I really want to represent my knowledge in a form that 'looks' more natural for card games. I know that Python is good for 'little languages'. Javascript perhaps less so. Maybe someone has elaborated on my fuzzy thinking.I'll be reading what you've suggested to see what I can make of it. Thanks again.
Bill Bell
+1  A: 

C++ and Javascript have enough similarities that you should be able to at least understand general concepts and how things work from C++ code..?

http://drac-cardlib.sourceforge.net/

I found DRAC to be a good reference for general card game programming. I ended up applying a few of their approaches in my own poker AI simulations.

FerretallicA
Looks interesting! Thank you.
Bill Bell