Rock-Paper-Scissors
Andreas Junghanns writes: "Check out the Second
International RoShamBo Programming Competition for a completely
different experience!
If you think you know everything about Rock-Paper-Scissors -- here is your
chance to prove it against some stiff international competition. At the Web site
you can find rules, sample programs and a report of the first contest,
complete with results and program descriptions." This looks pretty cool, and it might make a neat first project for someone, too.
My submission, Iocaine Powder, won last year's competition. Follow the link to see a complete description of how it works. The competition results from last year describe some of the other strategies that did well (and some that did not-so-well).
This competition is more complex than it seems; not only are there deliberate "dumb robots", but many of the real entries are quite predictable. A random player wouldn't have made it close to winning, and stalemates were rare.
What does this year hold in store? We'll just have to see!
I'm really not suprised that all you gun-toting, neo-nazi Americans would try to glorify some excessively violent childhood game like Rock Paper Scissors. Have any of you stopped to consider what these sorts of values these pasttimes instill in our children?
I mean, let's start with the rock. And I'm not refering to that movie with Nicholas Cage & Sean Connery in it, either. Rocks == Violence! Ask any caveman! Were it not for Oog being silenced by the Lameness Filter, I assure you he would back me up on this.
As for the scissors, well why don't you just throw children off a cliff? How many times have we been told not to run with scissors, and here /. is urging people to use them as both toys and weapons!
And the paper... oh Lord, how irresponsible can you get? We do all we can to squash that horrible "Puff the Magic Dragon" degenerate druggy song and then you people come along and start handing out Zig Zag's to elementary school students!
While we're at it, let's review the "premise" of this whole "game":
Are any of you thinking about the children? I seriously doubt it!
It's just like that game in the movie "Princess Bride", where a man reasons that to poison your drinking partner, you put the poison into your own glass. If he is suspicious he will switch with you when your back is turned, and will bring about his own doom. However, if he is a step cleverer than that, it becomes impossible to outsmart him - as the reverse-reverse psychologies pile up, the game boils down to random chance. Of course, the hero in the movie knew this and poisoned both glasses. After his opponent got thorougly lost in a maze of pseudo-logic, he took his poison and that was that.
That's the kind of visual image I get of someone trying to write a program that would win this contest - the "inconceivable!" guy from princess bride.
I wonder how a simple markov chain would do. That's where the probability of every move is based on the outcome of the previous game. For instance, "2 of the 3 times his rock beat my paper, his next move was scissors, so since his rock just beat my paper again, I'll anticipate scissors this time and go rock." I think this kind of reasoning would beat your typical human roshambo player in the long run, since a human would typically have a certain response based on what just happened.
Obviously, it's different with a computer. The program might anticipate this kind of thing, and has no general "feeling" that would you any reason to link a round to the one that came before. The more I think about this, the more I think it's just a matter of guessing right what other people will do.
--
grappler
Vidi, Vici, Veni
Several cheater bots were entered in the last tournament. They were disqualified, of course, but here are the funniest ones:
For more info, see this page (near the bottom).
------
The catch is that they put in some deliberately dumb robots, so that if you just use the optimal mixed strategy (randomness), you've got a 50% chance of beating them, but you can clobber them if you've got an actual plan.
In their FAQ, they tell you not to submit the random strategy, because it'll be guaranteed to finish in the middle of the pack.
--
No more e-mail address game - see my user info. Time for revenge.
Win dain a lotica, en vai tu ri silota
It seems to me that since they've also told you that random() is to be used, someone very clever could try to predict the opponent's choices based on sequence random() is returning. You aren't allowed to reseed it of course, but if your code is getting a certain sequence of numbers, is it possible to write code to figure out the current seed, and thus the entire sequence of numbers? Based on where your code winds up picking up the sequence, you know how many random numbers the opponent generated each round. Using that, you can possibly draw a correlation between the numbers you know he's getting and the choices he makes.
Granted, this is a longshot, and I know I'm not that clever, but on the other hand, there are lots of random number generators out there free for the taking. I'd spend the few minutes to add one to my code just to guarantee an attack like this won't work.