Live data from Hacker News

Rock Paper Scissors Programming Competition

rpscontest.com

11–18 of 18 posts

Re: Rock Paper Scissors Programming Competition

#11
No one yet has mentioned an approach that I had a lot of fun with. It was a 15~20 liner one-off in Python that earned quite a few wins for one of these RPS competitions. I lost the code with the laptop to a disk crash.

All it did was keep around compressed concatenation of the opponents plays, and a compressed concatenation of opponent and my plays interleaved. When it was my turn to play, I would extend the strings with the three possible one turn plays, i.e. extend by 'r', 'p', 's' and re-compress, whichever gave the shortest compression was my guess of what the opponent would play next. Then I would play whatever defeated opponent's guessed play.

The whole thing was 15~20 lines but of course I was standing on shoulder of giants and the std library. The prediction part was entirely abstracted / co-opted out to the compressor. Better compressors would yield better results. Lempel-Ziv worked well enough as long as there were enough rounds.

The theory for this can run quite deep. There are algorithms that will do the best possible if the opponent is using a finite state m/c, which computers are anyway. The performance of these are determined by the state space of the FSM. If one wants to go deeper then one would land in the territory of Kolomogorov complexity.

Re: Rock Paper Scissors Programming Competition

#13
post #4

I participated in a Google hosted one a while back and it was great fun. There is a great push and pull between trying to be as random as possible while attempting to exploit non-randomness in your opponents. I ended up going with a 'many demons' solution whereby I had many strategies voting on what the guess should be and I modulated the weight of their votes based on their success. I also used 'sicillian logic' to…

Reminds me of the clever strategy that won a prisoner's dilemma contest. http://archive.wired.com/culture/lifestyle/news/2004/10/6531...

Or The Alliance of Pacifist Scum from RoboWar, a game I played back in the 90s.

http://robowar.sourceforge.net/RoboWar5/Theory/theory.html#A...

"Essentially, the idea behind the Alliance was a simple recognition that the scoring system for tournaments up to that point made no award at the time for killing one's enemy, only for surviving the battle. It mattered not even if the enemy was still alive, so long as you were alive at the conclusion. So in the Eighth Tournament, someone came up with the screwball idea that maybe they shouldn't bother even fighting at all unless they came under attack from their enemy. Either it was amazing coincidence or there was an active conspiracy of communication going on that I was unaware of to build these horrible things, because a few more of these guys showed up at once than coincidence would seem to warrant in the Eighth Tournament.

"I refer to this bunch as the Alliance because that's essentially what it is. The robots agree not to fight each other so that each gets full credit for all of their battles. When Allied Pacifist Scum are in battle with each other, both get 100% points for their battles. If they fought it out, each would get 50% if they were equally matched, and both might well get less than that, since a double kill doesn't benefit either one of them."

Re: Rock Paper Scissors Programming Competition

#14
post #9
post #7

The five-option " Rock-paper-scissors-Sheldon-Spock " version would be more fun.

Isn't it rock paper scissors spock lizard?

Scissors cuts Paper, and Paper covers Rock as they always have, Rock crushes Sheldon, Sheldon poisons Spock, Spock smashes Scissors, Scissors decapitates Sheldon, Sheldon eats Paper, Paper disproves Spock, Spock vaporizes Rock, and Rock crushes Scissors as it always has.

Re: Rock Paper Scissors Programming Competition

#15
post #4

I participated in a Google hosted one a while back and it was great fun. There is a great push and pull between trying to be as random as possible while attempting to exploit non-randomness in your opponents. I ended up going with a 'many demons' solution whereby I had many strategies voting on what the guess should be and I modulated the weight of their votes based on their success. I also used 'sicillian logic' to…

Reminds me of the clever strategy that won a prisoner's dilemma contest. http://archive.wired.com/culture/lifestyle/news/2004/10/6531...

This is the most clever I've seen: http://www.youtube.com/watch?v=S0qjK3TWZE8

He ensures his opponent has nothing to gain from defecting...

(Rules etc until 2m 30s, then the game)

Re: Rock Paper Scissors Programming Competition

#16
post #14
post #9

Earlier quoted context omitted.

Isn't it rock paper scissors spock lizard?

Scissors cuts Paper, and Paper covers Rock as they always have, Rock crushes Sheldon, Sheldon poisons Spock, Spock smashes Scissors, Scissors decapitates Sheldon, Sheldon eats Paper, Paper disproves Spock, Spock vaporizes Rock, and Rock crushes Scissors as it always has.

Yeah, that is incorrect, it's rock, paper, scissors, lizard, spock.

https://www.youtube.com/watch?v=x5Q6-wMx-K8

Re: Rock Paper Scissors Programming Competition

#17
post #15
post #4

Earlier quoted context omitted.

Reminds me of the clever strategy that won a prisoner's dilemma contest. http://archive.wired.com/culture/lifestyle/news/2004/10/6531...

This is the most clever I've seen: http://www.youtube.com/watch?v=S0qjK3TWZE8 He ensures his opponent has nothing to gain from defecting... (Rules etc until 2m 30s, then the game)

That's awesome. My favorite part is when the clever guy who kept his cool during the entire episode drops his jaw when he hears the other guy is going to use his winnings to re-spray his yacht.
Post reply on HN