Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ready-made Javascript library for modelling card games? [closed]

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.

like image 977
Bill Bell Avatar asked Oct 14 '22 11:10

Bill Bell


2 Answers

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).

like image 114
Alex Martelli Avatar answered Nov 15 '22 07:11

Alex Martelli


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.

like image 26
nathanchere Avatar answered Nov 15 '22 07:11

nathanchere