Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Design Patterns

 
Kevin Treadwell
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunatelly I don't know what does cribbage mean, neither what your application should do.

./pope
 
Maxim Katcharov
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at http://faq.javaranch.com/view?WhenToApplyDesignPatterns
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even if this is offtopic, can somebody put some light on what this game is all about?

thanks,
./pope
 
Jeff Langr
author
Ranch Hand
Posts: 799
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic