spock disintegrates rock and disassembles scissors.
lizard poisons spock and eats paper.
you goal is to write a non-random algorithm that will compete against other such algorithms in a game of rock paper scissors lizard spock.
you will be given all the moves you have played so far ( a[] ) along with all your opponents moves ( b[] ), and the round you are currently on ( i ). the player who wins the most rounds will get 1 point. the player with the most points at the end of the tournament wins!
some example programs:
cycle(int a[],int b[],int i){
return i%5;
}
this program just goes through the 5 choices in order.
titForTat(int a[],int b[], int i){
if (i == 0) return SPOCK;
return b[i-1];
plays spock for the first move, after that simply plays opponents previous move.
(note: most programs will require a static first move.)
pseudoRandom(int a[],int b[], int i){
if (i == 0) return SCISSORS;
total = 0;
for(int j = 0; j<i; j++){
total += a[j] +b[j]
}
return total%5;
this program doesn't try to do anything fancy, just take the total of all the previous moves and use that to play a "random" move.
any questions feel free to ask. note that you don't actually need coding skills just a description of what you want it to do will be fine.
Question
Guest
rock breaks scissors and crushes lizard.
paper covers rock and disproves spock.
scissors cut paper and severs lizard.
spock disintegrates rock and disassembles scissors.
lizard poisons spock and eats paper.
you goal is to write a non-random algorithm that will compete against other such algorithms in a game of rock paper scissors lizard spock.
you will be given all the moves you have played so far ( a[] ) along with all your opponents moves ( b[] ), and the round you are currently on ( i ). the player who wins the most rounds will get 1 point. the player with the most points at the end of the tournament wins!
some example programs:
this program doesn't try to do anything fancy, just take the total of all the previous moves and use that to play a "random" move.
any questions feel free to ask. note that you don't actually need coding skills just a description of what you want it to do will be fine.
Edited by phillip1882Link to comment
Share on other sites
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.