File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes Design Patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Design Patterns" Watch "Design Patterns" New topic
Author

Design Patterns

Kevin Treadwell
Greenhorn

Joined: Nov 16, 2004
Posts: 2
Hi all

Relatively new to JAVA, i am looking for some existing design patterns for card games, i have searched the web and not getting much success. Trying to develop a cribbage game but i wanted an existing Design Pattern like Model View Controller MVC.

Can anyone help?

Kev
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Unfortunatelly I don't know what does cribbage mean, neither what your application should do.

./pope


blog - InfoQ.com
Maxim Katcharov
Ranch Hand

Joined: Sep 07, 2004
Posts: 113
What kind of problem are you facing?

I don't believe there will be specific patterns out there for specific card games. You may be looking for a design, which is different from a pattern - a pattern will apply in many situations, a singular design will apply only to what it was made for, such as a cribbage game.

If you'd like to see how someone made/designed a card game, try to look for open source or example versions to learn from. Be careful to respect the authors copyright if you do chose to do this.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Take a look at http://faq.javaranch.com/view?WhenToApplyDesignPatterns


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

Originally posted by Kevin Treadwell:
Hi all

Relatively new to JAVA, i am looking for some existing design patterns for card games, i have searched the web and not getting much success. Trying to develop a cribbage game but i wanted an existing Design Pattern like Model View Controller MVC.

Can anyone help?

Kev


Funny, that was one of the games that I had wanted to write in Java, but just don't have the time.

Let me know when you are done, so I can play.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Even if this is offtopic, can somebody put some light on what this game is all about?

thanks,
./pope
Jeff Langr
author
Ranch Hand

Joined: May 14, 2003
Posts: 762
It's a two-player card game, most recognizable by a pegboard used for scoring.

Basic idea (not the precise rules):

For every round, each player gets 6 cards and discards two. The four discarded cards become the "crib;" the crib is not viewed until all cards have been played for the round. The top card of the deck is exposed. Players alternate placing cards, nondealer first, and score points on various occurences (including total of cards = 15; closest to 31; runs of 3 or more; pairs). Players then score their hands for various combinations, including totals of 15, multiples (pairs+), flushes, and runs; these combinations are made in conjunction with the upcard. Dealer gets the benefit of making combinations using the crib. Winner is first to a predetermined number of points, usually 121.

There are a handful of details missing. More complete rules: http://www.mastersgames.com/rules/cribbage-rules.htm
[ November 17, 2004: Message edited by: Jeff Langr ]

Books: Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Hi Jeff! Very nice of you giving me those hints. Seems a pretty complex game, but however I do not feel that the game details will have an impact on the solution (but i might be very wrong).

./pope
 
 
subject: Design Patterns