Petras has asked for the wisdom of the Perl Monks concerning the following question:

Hi! I'm trying something that might prove to be just a bad idea, but someone's got to do the unofficial testing!

I learned a new and fun card game overseas, and the Hash Array makes Perl a great language to keep track of all the movements and where everything is. And it will make networking the game easier later when I learn how to network :~)

I'd like to use the pre-written CARDS.DLL that comes with Windows (doh!) but don't have the foggiest idea how to do that. RTFMing and STFWing and CPANing hasn't helped. I guess I don't need answers (though I'd take them!). I need someone to point and say, "Start seeking there!"

Any Pointers?

Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats.

-Howard Aiken

Replies are listed 'Best First'.
Re: Using .DLL files
by PodMaster (Abbot) on Apr 21, 2003 at 06:11 UTC
    use Win32::API;

    You'll also need to know How to use cards.dll (turned up by a quick google).

    update: You might also wanna checkout Win32::GUI (and if those two can't do what you wish, then you'd probably be delving into perlxs, in which case see perlxstut).


    MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
    I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
    ** The Third rule of perl club is a statement of fact: pod is sexy.

      Hey, thanks! So I'm thinking (thinking without checking first which makes me stupid) that I should find a good "RTFM and Beyond" tutorial.

      I'll let you see the game when I'm done, if you want. If I use WIN32:API in my programming, I'm guessing the linked DLL file will only work in a windows (and maybe Lindows?) environment, right?

      Thanks again,
      Petras
      Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats.

      -Howard Aiken

        Just so you know, CARDS.DLL has little more than the card images. It's also not a "redistributable" file, so if you want to give other people your game, only those people who already have CARDS.DLL can play it.

        If you're looking for card images and card libraries, there are definitely many such things out there. Some are even under user-oriented licenses like the GPL or the Artistic license. They may be easier to incorporate than CARDS.DLL, and run on more platforms, to boot.

        While you're ruminating on these topics, here's a tip: develop the logic of the game(s) separate from any presentation. Model the tableau, the deck, the hand, the player and the game as separate objects each with their own general purpose logic. Make a quick text-only interface to manipulate these objects ("2H 3H 4H 5H 6H" is a straight flush). Then you can swap out the text-only for the graphical interface when you know what route you want to take.

        --
        [ e d @ h a l l e y . c c ]

Re: Using .DLL files
by toma (Vicar) on Apr 21, 2003 at 15:52 UTC
    It doesn't use your DLL approach, but I have seen some nice card games made with Games::Cards and Games::Cards::Tk. These modules separate logic from presentation. They also handle details like shuffling, sorting, decks and piles.

    It should work perfectly the first time! - toma

      I gave them a look. I've always liked to tackle things far above my head because it makes me learn something, usually. Actually the whole program is going to take some learning (I could write the algorithims in Java, but I'm trying to leave *that* chapter of my life behind me ;). CPAN always leaves me scratching my head but yet more useful as a programmer. Thanks for pointing me in the right direction!
      Petras

      Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats.

      -Howard Aiken