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
In reply to Family/Kids dice game 'Skunk' study by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |