scissors_papers_stone

S

Scissors Paper

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.
 
A

Alex Young

Scissors said:
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?
 
M

M. Edward (Ed) Borasky

James said:
This was a Ruby Quiz some time ago:

http://www.rubyquiz.com/quiz16.html

James Edward Gray 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.
 
J

John Joyce

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...
 
M

M. Edward (Ed) Borasky

John said:
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...
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".
 
A

AEtzold

-------- Original-Nachricht --------
Datum: Tue, 30 Oct 2007 22:08:01 +0900
Von: John Joyce <[email protected]>
An: (e-mail address removed)
Betreff: Re: scissors_papers_stone
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...

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
(3*p_sto-p_pap) whenever your opponent shows scissors,
(p_sci-2*p_sto) whenever your opponent shows paper,
(2*p_pap-3*p_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 (3*p_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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,044
Members
48,769
Latest member
Clifft

Latest Threads

Top