I was playing Skunk, and had enough brain-power free to wonder if there is any meaningful strategy possible. It reminds me a lot of the "tit for tat" computer tournament where different strategies would win in different populations, but the most general good strategy was surprising and simple.

So, I'm thinking of a Perl Skunk Tourney. Everyone who cares would submit a module that defines an object representing his player. At the simplest, it need only provide a function that returns true/false when called to ask if he wants to roll again or stand. Passed in as parameters are immediatly interesting stats about his turn, and a "game" object that can be inspected for more details on what all players are doing.

What do you think?
About the Tourney program framework idea, not just the specific game.

I'm thinking that every submitted file will be placed in a directory for that purpose, and the names of the players can be picked up by loading all files in that directory. The main script would set up auto-turnaments of whatever sizes and elimination rules, or a turnament of whoever is specifically asked for. A player's object can have more than one instance.

So, what's an elegant way for a main script to figure out what was just loaded? Is the "return value" (the last statement executed) in a require saved anywhere? Update: Yes, it's the return from a require statement.

I'll trust the player's code not to cheat--modify the game object, write outside its package, etc. so I don't plan on doing any heavy security stuff.

—John

Replies are listed 'Best First'.
Re: Family/Kids dice game 'Skunk' study
by Mr. Muskrat (Canon) on Jun 20, 2003 at 13:44 UTC

    'Skunk' is played with two 6 sided dice. Each player in turn rolls the dice adding the points to their score. A player may continue rolling as long as they want, provided that they don't get 'Skunked'. If a player rolls a 1, they are 'Single Skunked'; their turn is over and any points earned during this turn are forfeited. If a player rolls two 1's, they are 'Double Skunked'; their turn is over and all points earned during the game are forfeited. The first player to 100 points wins the game.

    Ideas for computer player behavior:

    • player rolls three times unless skunked sooner
    • player rolls until it receives a turn score of 25 or is skunked
    • player rolls until it reaches 100 points or is skunked

      Thanks for the summary.

      Let me add to that that this is just one "hand" or "round", and the outer level involves poker chips or pennies.

      Every player antes up. I don't remember how much from the branded game set I had as a kid, but 5 seems to work well.

      Upon getting a skunk, put in 1.

      Upon getting a double-skunk, put in 10. I think it was 10, but I set it to 5 too since it seems to make a good game.

      Upon reaching (or passing) a committed score of 100 (that is, points accumulated this roll don't count until you "stand"), all other players get one last turn. They may exceed your score, and thus win!

      Winner is the highest score (earliest to play last wins a tie; you have to exceed to overthrow the winner), and takes the pot.

      So, you may want to minimize how many times you have to put in a chip, even if that doesn't affect your loosing status. That is, should someone already way behind just roll once each turn, to not lose any more cash?

      My sample players provided with the framework include (1)always roll N times or until skunked; (2) roll until reaching N points or untill skunked.

      —John

Re: Family/Kids dice game 'Skunk' study
by foebea (Initiate) on Jun 20, 2003 at 02:21 UTC
    I like it, reminds me of the old codewars in asm. that game is still going on so the concept is solid. I would love to see perl join the arena. As for execution, I am not yet wizardly enough to start off something like this, but I will check around at work.
Another thought..
by foebea (Initiate) on Jun 20, 2003 at 23:51 UTC
    This could be housed in a cgi. The page could display rules, stats of previous players, templates for competitors to build code from etc. This would give players a chance to play single player games to hone thier entry, and then could select another user housed on the page to compete against.

    The player programs would send data to a form on the site which would respond with the results, this would be read back into the program to make a decision of what to do next.

    Once the player is satisfied, they can post the code to the page so others can play against it, and stats can be collected on it for wins and losses.

    monthly or weekly, all submission can be brought into a battle royale tournament with the winner getting a prime posting on the front page.

    i don't know if it would work.. but i like it..
      I think a repository of players would be handy, but the play doesn't have to be done on the host. You can download the players and the main script and run any configuration you like locally.