Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Gaming

  1. #1
    New to the CF scene
    Join Date
    Aug 2005
    Thanked 0 Times in 0 Posts


    Does anyone know of a tutorial for writing gaming programs such as poker? I need the code for dealing. Would this be like a random program command? How would you set the limits (cards in each suite)?

  • #2
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Chamonix, France
    Thanked 3 Times in 3 Posts
    Poker is one very complex game to try and code. Not least of which is that you will either require Artifical Intelligence if the opponent is the computer, or a centralised gaming engine for multiplayer games - JavaScript is client-side and therefore any "card action" only takes place on one user's computer.

    So you would need a change of environment - a server-side application or a downloadable executable that all reference the same gaming server. Appropriate languages would include, but not limited to, Java, C++, maybe even Visual Basic.

    Logic is the same for dealing cards, but syntax is different for each language.

    Best policy is to learn a language and a technology pretty well before embarking on a project such as this. I would suggest downloading some poker apps and working out how they work, figure out what language they are written in and go from there.

    Hope this helps.

    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts