Now that all of the final entries are in, I can show all of you that I'm not a raving lunatic.
To quote the competition guidelines:
Quote: "The scoring system ensures that programs which choose purely random choices will never win."
And to quote Diggsey:
Quote: "As long as there are at least two non-random entries, the random entries cannot win."
I do not believe this is true. Earlier, I said that any program designed to discern a pattern in its opponent's moves can ultimately be thwarted by a random generator, by virtue of the fact that basing your moves off of random moves makes your moves random themselves. In effect, a random generator turns any "non-random" program into a random generator. Thus in theory, should one person submit a random generator as their entry, every program it faces has an equal chance of winning or losing, taking all of the skill in programming out of the question.
If by following this logic, you are still not convinced, I've taken all of the final entries and paired them against a random generator. I've used Valle's competition setup with very slight modifications to run 1000 games of 100 rounds each. Then, I calculate the percentage of the games with an actual winner, won by the player, and won by the random generator. Here is the setup:
#constant CHOICE_ROCK 0
#constant CHOICE_PAPER 1
#constant CHOICE_SCISSORS 2
`Any Player initialization goes here:
sync on : sync
print "Let the games... BEGIN!"
sync
wait key
Games=1000
for t = 1 to Games
player1_score = 0
player2_score = 0
for i = 1 to 100
rem Get the player guesses
player1_choice = Player1_Guess()
player2_choice = Player2_Guess()
rem Validate the gueses
if player1_choice > 2 or player1_choice < 0
print "Invalid player 1 choice!"
sync
wait key
endif
if player2_choice > 2 or player2_choice < 0
print "Invalid player 2 choice!"
sync
wait key
endif
rem Tell each player what the other chose
Player1_Result(player1_choice,player2_choice)
Player2_Result(player2_choice,player1_choice)
rem Find the result of the round
result = Choice_Winner(player1_choice,player2_choice)
rem Increase scores
if result = -1
inc player2_score
else
if result = 1
inc player1_score
endif
endif
next i
cls
print ""
print "ROUND ";t;"/";Games;":"
print "Player 1: " + str$(player1_score)
print "Player 2: " + str$(player2_score)
print ""
print "RESULT:"
rem Must win by at least 10 rounds
if abs(player2_score-player1_score) < 10
print "It's a draw!"
else
if player2_score > player1_score
print "Player 2 wins!"
inc bigscore2
else
print "Player 1 wins!"
inc bigscore1
endif
endif
sync
next t
cls
print ""
print "FINAL SCORE"
print "Player 1 won ";bigscore1;" rounds"
print "Player 2 won ";bigscore2;" rounds"
print "Tie Rounds: ";Games-bigscore1-bigscore2
print "Player 1 Win Percentage: ";(100.0*bigscore1)/(bigscore1+bigscore2)
print "Player 2 Win Percentage: ";(100.0*bigscore2)/(bigscore1+bigscore2)
print ""
sync
wait key
end
rem Returns name of choice
function Choice_Name(a)
name$ = ""
select a
case 0
name$ = "ROCK"
endcase
case 1
name$ = "PAPER"
endcase
case 2
name$ = "SCISSORS"
endcase
endselect
endfunction name$
rem Returns +1 if 'a' wins, -1 if 'b' wins, 0 if they draw
function Choice_Winner(a,b)
c = (a+3-b) mod 3
if c = 2 then c = -1
endfunction c
`Player Code Here:
////////////////////////////////////ENEMY
function Player2_Guess()
rand = rnd(2)
endfunction rand
function Player2_Result(choice,other_choice)
endfunction
For each player's entry, I ran the setup three times and posted the percentage results below:
BMacZero - Random Generator:
50.9506% - 49.0494%
49.3724% - 50.6276%
46.8% - 53.2%
Aurum Knight - Random Generator:
49.7872% - 50.2128%
52.4444% - 47.5556%
46.4% - 53.6%
Valle - Random Generator:
52.0492% - 47.9508%
49.0272% - 50.9728%
49.1667% - 50.8333%
fearred - Random Generator:
46.7213% - 53.2787%
55.9242% - 44.0758%
48.6607% - 51.3393%
Neuro Fuzzy - Random Generator:
51.8987% - 48.1013%
50.6276% - 49.3724%
47.1545% - 52.8455%
As you can see, no "non-random" entry beats or loses to a random generator, because they become, in effect, random generators themselves. If one were to increase the number of games played, I'm sure the percentages would tend to 50.0%.
All of this proves my point, that I could enter this:
function Player1_Guess()
Choice=rnd(2)
endfunction Choice
function Player1_Result(choice,other_choice)
endfunction
as my entry and have an exactly equal chance of winning the competition. This is why a competition of Rock, Paper, Scissors isn't the best idea. I do like the idea of competition, but not with a game that can be beaten randomly.