For whatever reason I've decided to develop an online version of the game called Sets which I was introduced to last night.

The game goes something like this: cards are layed down in a 4x4 grid face up. Each card has four attributes: number of items on it (1,2,3), shape, color, and shading type. The goal is to find sets. A set consists of three cards which foreach of the four attributes have either:

  • a) all of a given attribute in common,
    (or)
  • b) unique/different values for a given attribute for all three cards

    An example set:
    Blue
    3 Circles
    Solid fill
    Green
    3 Triangles
    Empty Fill
    Red
    3 Squares
    Hash Fill

    Explanation: this is a set because all of the colors are different, all of the shapes are different, all of the shading/fill types are different, and all of the numbers are the same.

    Eventually I'd probably like to come up with a TK version and add lots of stats to keep track of what types of sets a given player tends to find first out of all the possible sets they could find at a given point of the game. This would possibly shed some light on the quickest/easiest type(s) of pattern matching for a given player.

    I'm looking for different ways of maintaining the game state. Storable/DB_Files seem like the obvious solution but I am also curious as to what some other alternatives might be.

    vroom | Tim Vroom | vroom@blockstackers.com


    In reply to Ways to maintain state in a CGI based card game by vroom

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.