Scissors_papers_stone

making a game for uni in ruby for the first time, called scissors papers
stone and wanted to know if you can find out what method your oppenents
are using before they use and and counter them.

Scissors Paper wrote:

making a game for uni in ruby for the first time, called scissors papers
stone and wanted to know if you can find out what method your oppenents
are using before they use and and counter them.
That depends on the implementation - are you playing against other
people on the network, at the same machine, against the CPU, or some
other manifestation?

On Oct 29, 2007, at 6:06 AM, Scissors Paper wrote:

making a game for uni in ruby for the first time, called scissors
papers
stone and wanted to know if you can find out what method your
oppenents
are using before they use and and counter them.

This was a Ruby Q. some time ago:

Ruby Quiz - Paper Rock Scissors (#16)

James Edward G. II

On Oct 29, 2007, at 7:53 PM, M. Edward (Ed) Borasky wrote:

Hmmm … reminds me of the old Claude Shannon penny matching
machine. Isn’t rock/paper/scissors the base-three equivalent of
that? Anyhow, if you can find the Shannon paper, it will give you
some clues on how to do rock/paper/scissors against a human opponent.

Oh but it is so much more than a number game.
It is about timing and has the x-factor of personality like in Poker.
Doesn’t make a good computer game.
As “janken” in Japan it is frequently used to settle minor disputes
and make decisions by people of all ages.
Yet, I’ve never seen a video game version of it in Japan…

John J. wrote:

Ruby Quiz - Paper Rock Scissors (#16)
As “janken” in Japan it is frequently used to settle minor disputes and
make decisions by people of all ages.
Yet, I’ve never seen a video game version of it in Japan…

There’s a similar Italian game (I’ve forgotten the name) that involves
one, two or three fingers. That one I’m pretty sure is in “The Compleat
Strategist”.

James Edward G. II wrote:

James Edward G. II

Hmmm … reminds me of the old Claude Shannon penny matching machine.
Isn’t rock/paper/scissors the base-three equivalent of that? Anyhow, if
you can find the Shannon paper, it will give you some clues on how to do
rock/paper/scissors against a human opponent.

-------- Original-Nachricht --------

Datum: Tue, 30 Oct 2007 22:08:01 +0900
Von: John J. [email protected]
An: [email protected]
Betreff: Re: scissors_papers_stone

This was a Ruby Q. some time ago:
Doesn’t make a good computer game.
As “janken” in Japan it is frequently used to settle minor disputes
and make decisions by people of all ages.
Yet, I’ve never seen a video game version of it in Japan…

There is a discussion of this game in the book “The Compleat
Strategyst”,
by J.D. Williams, pp. 98 and following in my (Dover) edition.
From the “payoff matrix” of this game, one finds that there is no
dominant strategy and that players should play each strategy on a 1:1:1
basis, i.e. choose each of the three symbols with equal probability.

But things change if you give different payoffs for different encounters
(e.g.
three dollars to a player if she or he wins in a stone/scissors
encounter,
two dollars to a player if she or he wins in a paper/stone encounter,
and one dollar to a player if she or he wins in a scissor/paper
encounter,
( that situation is discussed in the book “The mathematics of games” by
John D. Beasley, Oxford University Press.)

If you always chose the same object, your
opponent can adapt to that and win over you. So you must mix your
choices with some probabilities p_sci,p_sto,p_pap, so that

p_sci+p_sto+p_pap=1.

Your average gain will be
(3p_sto-p_pap) whenever your opponent shows scissors,
(p_sci-2
p_sto) whenever your opponent shows paper,
(2p_pap-3p_sci) whenever your opponent shows stone.

Now, you can’t make all these gains positive by choosing the values
for p_pap,p_sci,p_sto, as this requires (3p_sto>p_pap),
(p_sci>2
p_sto),
(2*p_pap>3p_sto), and thus 6p_sto>2p_pap>3p_sci>6p_sto, that’s
impossible.

But you can achieve that none of the gains is negative, by setting

p_sci=1/3,
p_pap=1/2,
p_sto=1/6.

If you vary this strategy, at least one of your gains is negative,
and your opponent wins. So it doesn’t matter what your opponent does,
as long as you play your optimal strategy.
On the other hand, your opponent can play it the same way.
Thus, nobody wins (on average).

How to implement such a game for more general payoffs?
Maybe you just use some external
linear programming tool like glpk that has Ruby bindings
http://groups.google.de/group/ruby-talk-google/browse_thread/thread/11f0a2029ad2bfd3

Best regards,

Axel