Jump to content
BrainDen.com - Brain Teasers
  • 0


unreality
 Share

Question

Here's the challenge: write a little code snippet in java or just generic pseudocode or even just describe your algorithm (you don't even have to know programming, I can just convert your algorithm for you!) that plays ROCK PAPER SCISSORS against an enemy... that enemy is another algorithm!

THE GAME

We all know the game rock paper scissors could use a little strategy... sure there is some psychological merit to it, but most of it is luck. Well, that's about to change.... you will create a deterministic algorithm that will battle against other algorithms for the ultimate title of ROCK PAPER SCISSORS CHAMPION!!! There will be no randomness functions, no chance, no luck. It's about skill. Is your algorithm a simple numerical ninja? Or is it a complex meta-algorithm that attempts to counterguess the enemy's strategy? MAY THE BEST ALGORITHM WIN!!!!!

TECHNICAL SPECS

Your algorithm has access to three different inputs: it has an array of all the moves its used previously. This array is called a. There is another array, b, that contains the moves used by the enemy in this match. You also have a variable, i, that denotes the round number (i=0 is the first round, i=1 is the next round, then i=2, etc).

Right now I have the global var numRounds set to 50. Ie, there will be 50 rounds before we see whose won more games. Let me know if you think that number should be something else.

0 = ROCK

1 = PAPER

2 = SCISSORS

[rock beats scissors, scissors beats paper, paper beats rock]

the arrays a & b are of the datatype int and hold zeroes, ones and twos up to a or b. a and all values after that in the array is NULL, same with b. So the array is only defined from a[0] to a[i-1] or equivalent for b.

For the very first round, i=0, there will be nothing in the arrays. So if your algorithm uses previous data to make future decisions, you'll need to have some primer value for i=0

For anyone interested, here is my java code that runs all this:



// ROCK PAPER SCISSORS CONTEST FOR BRAINDEN

//  BY UNREALITY

//    ENJOY

import java.util.Scanner;

public class ropasc

{

    public static int numGames = 50;

// rock: 0

// paper: 1

// scissors: 2


    private int[] myTurns; private String myName;



    public ropasc(String name)

    {

        myName = name;

        myTurns = new int[numGames];

    }


    public int[] get()

    {

        return myTurns;

    }


    public String getName()

    {

        return myName;

    }


    public int next(int[] enemy, int i)

    {

        int x=0;

        if (myName=="Test1") x = test1(myTurns, enemy, i);

        if (myName=="Test2") x = test2(myTurns, enemy, i);

        if (myName=="Test3") x = test3(myTurns, enemy, i);

        // etc. Could use "java.lang.reflect.*" to do this more elegantly but this way is simpler

        myTurns[i] = x;

        return x;

    }


    public int test1(int[] a, int[] b, int i)

    {

        if (i==0) return 2;

        return b[i-1];

    }


    public int test2(int[] a, int[] b, int i)

    {

        return i % 3;

    }


    public int test3(int[] a, int[] b, int i)

    {

        int sum = 0;

        for (int z=0; z<i; z++)

        {

            sum += (a[z] + b[z]);

        }

        sum %= 3;

        return sum;

    }


    public static String conv(int k)

    {

            if (k==0) return "ROCK";

            if (k==1) return "PAPER";

            if (k==2) return "SCISSORS";

            return "";

    }


    public static void main(String[] args)

    {


        String na = "", nb = "";

     /*   String na = "Test1"; // these two lines

        String nb = "Test2"; // will be the only ones changed to switch who is fighting whom */

        // how about, instead get user input?

        Scanner inp = new Scanner(System.in);

        System.out.print("\n\nFirst Algorithm: ");

        na = inp.next();

        System.out.print("\nSecond Algorithm: ");

        nb = inp.next();


        System.out.print(na + " vs " + nb + "\n\n");

        ropasc rps1 = new ropasc(na);

        ropasc rps2 = new ropasc(nb);

        int res1 = 0, res2 = 0, win1 = 0, win2 = 0, result = 2;

        for (int i=0; i< numGames; i++)

        {

            res1 = rps1.next(rps2.get(), i);

            res2 = rps2.next(rps1.get(), i);

            result = (2+res1+res2) % 3;

            if (result==1) win2++;

            if (result==0) win1++;

            System.out.println(conv(res1) + " vs " + conv(res2));

        }

        String zprint ="";

        if (win1>win2) zprint = rps1.getName() + " wins " + win1 + " games to " + win2 + "!!!\n";

        if (win1<win2) zprint = rps2.getName() + " wins " + win2 + " games to " + win1 + "!!!\n";

        if (win1==win2) { zprint = "Both players won " + win1 + " games! The match was a tie\n"; } else { zprint += "There were " + (numGames - win1 - win2) + " ties\n"; }

        System.out.print(zprint);

    }

}

New entrants will be like this:

public int nameOfAlgorithmint[] a, int[] b, int i)

{

// body here

}

and will be inserted into the program after the algorithm method for test3

All algorithms must return one of these three integers: 0 (ROCK), 1 (PAPER), 2 (SCISSORS)!!!

good luck and post here with remarks, questions, etc.... let's get a signup list?

1) Unreality

2) ...

should we shoot for eight people?

REMEMBER YOU DONT NEED TO KNOW PROGRAMMING... you just need to make a killer algorithm that's a whiz at R/P/S :) I can write the actual code for it for you if you want!

Link to comment
Share on other sites

  • Answers 257
  • Created
  • Last Reply

Top Posters For This Question

Recommended Posts

  • 0

It's possible that my code was affected by the same bug that I detected DarthNoob's code. :blush:

Try changing the second-to-last line of my code from this:

myMove = (myMove - 1)%3;
to this:
myMove = (myMove + 2)%3;

I forgot that negative values are valid results of modulus operators. If myMove was 0, then that would be returning -1. :duh:

We should probably be on the lookout for things like that since -1 is the same as 2 in mod 3, so anytime anyone is doing that, it probably should be changed to +2 instead. That way, there's no risk of going negative and the result should still be the same as what was intended.

Link to comment
Share on other sites

  • 0

Yes that's probably it... I've always been doing that (2 instead of, 1 instead of -2, etc) only because I wasn't sure how it worked with negative numbers and apparently too lazy to test it haha,, but I think if you use the operation "mod" instead of "%" it returns only those within 0 to n-1 range, not sure. Safer to just add 2 and %3... thanks for pointing that out! I'll change all of those instances where I see them in yours and other algos, as soon as the laptop with java is returned to my household :P (should be later today)

Link to comment
Share on other sites

  • 0

alright I changed that one thing in dawh's program (the -1 to a +2), ran it again, and here are the results!


Final Results:

phillip! vs plasmid!: plasmid! wins!!!

phillip! vs unreality!: unreality! wins!!!

phillip! vs dawh!: dawh! wins!!!

phillip! vs MrApple!: phillip! wins!!!

phillip! vs Framm!: phillip! wins!!!

phillip! vs SomeGuy!: phillip! wins!!!

phillip! vs jarze!: jarze! wins!!!

plasmid! vs unreality!: plasmid! wins!!!

plasmid! vs dawh!: plasmid! wins!!!

plasmid! vs MrApple!: plasmid! wins!!!

plasmid! vs Framm!: plasmid! wins!!!

plasmid! vs SomeGuy!: plasmid! wins!!!

plasmid! vs jarze!: plasmid! wins!!!

unreality! vs dawh!: unreality! wins!!!

unreality! vs MrApple!: unreality! wins!!!

unreality! vs Framm!: unreality! wins!!!

unreality! vs SomeGuy!: unreality! wins!!!

unreality! vs jarze!: unreality! wins!!!

dawh! vs MrApple!: dawh! wins!!!

dawh! vs Framm!: dawh! wins!!!

dawh! vs SomeGuy!: dawh! wins!!!

dawh! vs jarze!: dawh! wins!!!

MrApple! vs Framm!: Framm! wins!!!

MrApple! vs SomeGuy!: MrApple! wins!!!

MrApple! vs jarze!: jarze! wins!!!

Framm! vs SomeGuy!: Framm! wins!!!

Framm! vs jarze!: Framm! wins!!!

SomeGuy! vs jarze!: It was a tie!!!



Win Count:

phillip!: 3.0

plasmid!: 7.0

unreality!: 6.0

dawh!: 5.0

MrApple!: 1.0

Framm!: 3.0

SomeGuy!: 0.5

jarze!: 2.5



Type y for analysis y



[Algos: 8] [Games: 28] [Average Score: 3.5] [Sdev: 2.165] [MAD: 1.875]


From Greatest to Least:

       plasmid!: 7.0       [467 wins, 125 ties, 108 losses] 11.080

     unreality!: 6.0       [440 wins, 118 ties, 142 losses] 10.013

          dawh!: 5.0       [288 wins, 168 ties, 244 losses]  7.351

       phillip!: 3.0       [194 wins, 227 ties, 279 losses]  4.114

         Framm!: 3.0       [181 wins, 235 ties, 284 losses]  2.991

         jarze!: 2.5       [140 wins, 248 ties, 312 losses]  3.021

       MrApple!: 1.0       [180 wins, 235 ties, 285 losses]  1.380

       SomeGuy!: 0.5       [123 wins, 218 ties, 359 losses]  0.000


The biggest blowout game(s) was(were): 

plasmid! won 98 games and jarze! won 0 ~ there were 2 ties



Type y to play again n


Thanks for playing!


let me know if you want to see a specific game played out, or a specific chunk of code - the entire results page was far too big to post here

Link to comment
Share on other sites

  • 0

Can I see how mine did against your's and Plasmid's?

Framm! vs unreality!

rock vs scissors

paper vs scissors

scissors vs rock

paper vs rock

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

rock vs scissors

scissors vs scissors

rock vs rock

paper vs rock

scissors vs rock

rock vs paper

paper vs rock

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs scissors

paper vs rock

scissors vs rock

paper vs paper

scissors vs rock

rock vs scissors

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs paper

rock vs rock

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs paper

rock vs paper

paper vs scissors

scissors vs paper

paper vs paper

scissors vs rock

rock vs paper

paper vs scissors

scissors vs paper

rock vs paper

paper vs scissors

scissors vs rock

rock vs scissors

paper vs rock

scissors vs rock

rock vs scissors

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

paper vs paper

scissors vs rock

rock vs paper

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

paper vs paper

scissors vs rock

rock vs paper

paper vs rock

scissors vs rock

rock vs paper

paper vs scissors

scissors vs paper

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

scissors vs scissors

Framm! won 19 games and unreality! won 66 ~ there were 15 ties

unreality! wins!!!

Framm! vs plasmid!

rock vs paper

paper vs scissors

scissors vs paper

paper vs scissors

scissors vs rock

rock vs scissors

paper vs rock

scissors vs rock

rock vs paper

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

paper vs paper

scissors vs rock

rock vs paper

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

paper vs paper

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

paper vs paper

scissors vs rock

rock vs paper

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

paper vs paper

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

scissors vs scissors

Framm! won 3 games and plasmid! won 84 ~ there were 13 ties

plasmid! wins!!!

Link to comment
Share on other sites

  • 0

Mine did as well as I expected it to. Thanks unreality for having this contest, was fun!

yea, thanks for playing!! :D

I'd like to see mine against plasmid's if that's okay.

phillip! vs plasmid!

scissors vs paper

paper vs scissors

rock vs paper

scissors vs scissors

rock vs paper

paper vs rock

scissors vs paper

scissors vs scissors

paper vs paper

paper vs rock

paper vs rock

paper vs scissors

scissors vs paper

scissors vs scissors

scissors vs paper

scissors vs rock

paper vs rock

paper vs scissors

paper vs scissors

paper vs scissors

scissors vs scissors

scissors vs rock

scissors vs scissors

scissors vs rock

rock vs rock

scissors vs scissors

scissors vs rock

scissors vs rock

scissors vs rock

scissors vs rock

rock vs rock

rock vs rock

scissors vs rock

scissors vs rock

rock vs rock

rock vs rock

scissors vs rock

scissors vs rock

rock vs rock

rock vs rock

rock vs rock

rock vs paper

rock vs rock

rock vs paper

rock vs paper

rock vs paper

rock vs paper

rock vs paper

paper vs paper

paper vs scissors

paper vs scissors

paper vs scissors

paper vs scissors

paper vs scissors

scissors vs scissors

scissors vs rock

scissors vs rock

scissors vs rock

paper vs rock

paper vs scissors

scissors vs scissors

paper vs rock

scissors vs scissors

scissors vs rock

paper vs rock

paper vs scissors

paper vs scissors

paper vs scissors

paper vs scissors

paper vs scissors

paper vs scissors

paper vs scissors

scissors vs scissors

scissors vs rock

scissors vs rock

scissors vs rock

scissors vs rock

scissors vs rock

scissors vs rock

scissors vs rock

paper vs rock

paper vs scissors

paper vs scissors

paper vs scissors

rock vs scissors

rock vs scissors

paper vs paper

scissors vs scissors

scissors vs rock

scissors vs rock

scissors vs rock

scissors vs rock

rock vs rock

rock vs paper

rock vs paper

rock vs paper

scissors vs paper

scissors vs rock

rock vs rock

scissors vs paper

phillip! won 16 games and plasmid! won 59 ~ there were 25 ties

plasmid! wins!!!

~~~

and here is the code for the 8 algos that competed:


            else if (algoNum==34) //phillip!

            {

              int[] best;

   int start = 0, index = 0;

   int size = i, ties = 0;

   best = new int[2];

   if(i == 0) return SCISSORS;

   if(i == 1) return PAPER;

   if(i == 2) return ROCK;

   if(i == 3) return SCISSORS;

   if(i == 4) return ROCK;

   if(i == 5) return PAPER;

   while(size >1){

      for(int k = 0; k < 2; k++){

         for( int j = size*k/2 +start; j < size*(k+1)/2 +start; j++){

            if (a[j] == b[j]) ties += 1;

            else{

               if (a[j] == ROCK && b[j] == PAPER) best[k] += 1;

               if (a[j] == PAPER && b[j] == SCISSORS) best[k] += 1;

               if (a[j] == SCISSORS && b[j] == ROCK) best[k] += 1;


               if (a[j] == ROCK && b[j] == SCISSORS) best[k] -= 1;

               if (a[j] == PAPER && b[j] == ROCK) best[k] -= 1;

               if (a[j] == SCISSORS && b[j] == PAPER) best[k] -= 1;

           }


        }

     }

     int x = 0;

     if(best[0] < best[1]){

        x = 1;

     }

     else if(best[0] == best[1]){

        x = ties%2;

     }

     if(x == 1){

        start += size/2;

     }

     size = size/2;

     best[0] = 0;

     best[1] = 0;

  }     

  return b[start];

            }






            else if (algoNum==35) //plasmid!

            {

             // For the first two rounds, just play whatever

            if (i==0) return PAPER;

            if (i==1) return SCISSORS;


            // For subsequent rounds,

            // First, look for any earlier rounds where BOTH (1) you played your

            //   move from round i-1, and (2) the opponent played his move from

            //   round i-1

            // Take a tally of what the opponent played afterward

            int tally[] = {0,0,0};

            for (int round = 0; round < i-1; round++) {

              if ( (a[round] == a[i-1]) && (b[round] == b[i-1]) ) tally[b[round+1]]++;

            }


            // And if he has a favorite move to play in that situation, beat it

            if ( (tally[SCISSORS] > tally[PAPER]) && (tally[SCISSORS] > tally[ROCK]) ) return ROCK;

            if ( (tally[PAPER] > tally[SCISSORS]) && (tally[PAPER] > tally[ROCK]) ) return SCISSORS;

            if ( (tally[ROCK] > tally[PAPER]) && (tally[ROCK] > tally[SCISSORS]) ) return PAPER;


            // In case of tie, look at all prior rounds where EITHER you played your

            //   move from round i-1 OR the opponent played his move from round

            //   i-1, and add to the tally of what the opponent plays afterward

            for (int round = 0; round < i-1; round++) {

              if ( (a[round] == a[i-1]) || (b[round] == b[i-1]) ) tally[b[round+1]]++;

            }


            // Then play whatever beats his most common follow-up. In case there's

            //   not a clear favorite, just pick something

            if ( (tally[SCISSORS] > tally[PAPER]) && (tally[SCISSORS] > tally[ROCK]) ) return ROCK;

            if (tally[PAPER] > tally[ROCK]) return SCISSORS;

            return PAPER;

            }







            else if (algoNum==36) //unreality!

            {

                if (i==0) return SCISSORS; /* people started with ROCK in T1 so most people in T2 started with PAPER, this is to defeat those that start with PAPER or at least tie those who start with SCISSORS */

                if (i==1) return (b[0]+2)%3; /* if they expect me to beat what they played first, I'll beat THAT. This move will only lose if they play the same move twice in a row */

                if (i==2) return (b[1]+2)%3; /* same reasoning */

                // now for my algorithm

                ArrayList<Integer> vooma = new ArrayList<Integer>(50);

                ArrayList<Integer> voomb = new ArrayList<Integer>(50);

                ArrayList<Integer> checka = new ArrayList<Integer>(50);

                ArrayList<Integer> checkb = new ArrayList<Integer>(50);

                for (int goback = i / 2; goback > 0; goback--)

                {

                    vooma.clear(); voomb.clear();

                    for (int kk=i-goback; kk<i; kk++) { vooma.add(a[kk]); voomb.add(b[kk]); }

                    for (int startcheck=0; startcheck< i-goback-1; startcheck++)

                    {

                        checka.clear(); checkb.clear();

                        for (int jj=startcheck; jj<startcheck+goback; jj++) { checka.add(a[jj]); checkb.add(b[jj]); }

                        if (vooma.equals(checka) && voomb.equals(checkb)) return ((b[startcheck+goback]+1)%3);

                    }

                }

                // nothing was found to match, so play my last move that won

                for (int zz=i-1; zz>0; zz--)

                {

                    if ((3 + a[zz] - b[zz]) == 1) return a[zz];

                }

                // no winning moves??? (excluding i=0)

                return ROCK;

            }









            else if (algoNum==40) //dawh!

            {

                if(i == 0)

                return(ROCK);

        int predicted = -1;

        int success = 0;

        int wins = 0;

        int losses = 0;

        Vector<Integer> patt = new Vector<Integer>();

        for(int j = 0; j < i; j++) {

                int move = b[j];

                int myMove = a[j];

                if(move == ROCK && myMove == SCISSORS ||

                                move == SCISSORS && myMove == PAPER ||

                                move == PAPER && myMove == ROCK)

                        losses++;

                if(myMove == ROCK && move == SCISSORS ||

                                myMove == SCISSORS && move == PAPER ||

                                myMove == PAPER && move == ROCK)

                        wins++;


                if(patt.contains(move)) {

                        int idx = patt.indexOf(move)+1;

                        if(idx < patt.size()) {

                                predicted = patt.get(idx);

                        }

                }

                patt.add(move);


                if(j < i-1 && predicted == b[j+1])

                        success++;

        }

        int myMove = (b[i-1]+1)%3;

        if(success > i/2) {

                int move = b[i-1];

                int idx = patt.indexOf(move)+1;

                if(idx > 0 && idx < patt.size())

                        myMove = (patt.get(idx)+1)%3;

        }

        //If we are losing by more than five,

        //assume we are being anticipated and reanticipate them

        if(losses > wins + 5)

                myMove = (myMove + 2)%3;

        return(myMove);

            }





            else if (algoNum==41) //MrApple!

            {

                String convert = "Rock Paper Scissors";

                char[] car = convert.toCharArray();

                return ((car[i/8] >>> (7 - (i % 8))) % 2);

            }





            else if (algoNum==42) //Framm!

            {

                if (i/3 == 0) return i%3;

                int toti = i/3 + 1, ht = 0, maxhtreach = 3, multer = 1, rows = -1;

                while (toti > 0) {

                    ht += multer; toti -= ht; rows++;

                    if (ht == maxhtreach) { maxhtreach++; multer = -1; }

                    if (ht == 1) { multer = 1; }

                }

                return (i+rows)%3;

            }




            else if (algoNum==43) //SomeGuy!

            {

                int r=0,p=0,s=0;

                for (int einkil=0; einkil<i; einkil++) {

                    if (a[einkil]==ROCK) r++;

                    if (a[einkil]==PAPER) p++;

                    if (a[einkil]==SCISSORS) s++;

                }

                if (r<p && r<s) return ROCK;

                if (p<r && p<s) return PAPER;

                if (s<r && s<p) return SCISSORS;


                r=0; s=0; p=0;

                for (int einkil=0; einkil<i; einkil++) {

                    if (b[einkil]==ROCK) r++;

                    if (b[einkil]==PAPER) p++;

                    if (b[einkil]==SCISSORS) s++;

                }

                if (r>p && r>s) return ROCK;

                if (p>r && p>s) return PAPER;

                if (s>r && s>p) return SCISSORS;

                return ROCK;

            }



            else if (algoNum==45) //jarze!

            {

                // for now same as jarze

                if (i==0) return ROCK;

                return (b[i-1]+1)%3;

            }


hope everyone had fun! We can still add darthnoob/jazzship/izzy too, when/if those get done :D

Link to comment
Share on other sites

  • 0

It was certainly interesting thinking of and writing up the algorithms. I guess I'd be curious to see exactly how I fared against plasmid! and unreality! since those were the ones to beat.

(I'd also be curious to know whether dawh! would beat PatternSeekerDefeater since dawh! is just a tweaked version of PS. :lol: )

Link to comment
Share on other sites

  • 0

It was certainly interesting thinking of and writing up the algorithms. I guess I'd be curious to see exactly how I fared against plasmid! and unreality! since those were the ones to beat.

dawh! vs plasmid!

rock vs paper

scissors vs scissors

rock vs paper

scissors vs rock

paper vs paper

scissors vs rock

paper vs scissors

rock vs paper

paper vs rock

paper vs scissors

scissors vs paper

scissors vs scissors

rock vs paper

paper vs rock

paper vs scissors

scissors vs paper

scissors vs rock

rock vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs scissors

scissors vs paper

scissors vs rock

rock vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs rock

rock vs scissors

scissors vs paper

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

paper vs rock

rock vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

paper vs rock

rock vs paper

scissors vs scissors

paper vs paper

scissors vs rock

paper vs paper

scissors vs rock

paper vs paper

scissors vs rock

dawh! won 14 games and plasmid! won 77 ~ there were 9 ties

plasmid! wins!!!

dawh! vs unreality!

rock vs scissors

rock vs scissors

rock vs scissors

rock vs paper

scissors vs rock

paper vs rock

paper vs rock

paper vs rock

paper vs scissors

rock vs rock

paper vs rock

paper vs scissors

rock vs paper

scissors vs rock

paper vs scissors

rock vs paper

scissors vs rock

paper vs scissors

rock vs paper

scissors vs rock

paper vs scissors

scissors vs paper

scissors vs rock

rock vs scissors

rock vs paper

paper vs rock

paper vs scissors

scissors vs paper

scissors vs rock

rock vs paper

paper vs rock

rock vs scissors

rock vs paper

paper vs rock

paper vs scissors

scissors vs rock

rock vs scissors

scissors vs paper

scissors vs rock

rock vs paper

paper vs scissors

scissors vs paper

paper vs rock

rock vs scissors

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

dawh! won 19 games and unreality! won 80 ~ there were 1 ties

unreality! wins!!!

(I'd also be curious to know whether dawh! would beat PatternSeekerDefeater since dawh! is just a tweaked version of PS. :lol: )

dawh! vs pattern_seeker_defeater

rock vs paper

scissors vs rock

paper vs scissors

rock vs paper

scissors vs rock

paper vs scissors

scissors vs paper

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

rock vs scissors

scissors vs rock

dawh! won 47 games and pattern_seeker_defeater won 53 ~ there were 0 ties

pattern_seeker_defeater wins!!!

it was close though :P

If it is not too much trouble can I just see the wins, losses, and ties for each of my rounds?

Framm! vs phillip!

rock vs scissors

paper vs paper

scissors vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs rock

scissors vs rock

rock vs rock

scissors vs rock

rock vs rock

paper vs paper

scissors vs paper

rock vs paper

paper vs rock

scissors vs paper

rock vs scissors

paper vs scissors

rock vs scissors

paper vs scissors

scissors vs scissors

rock vs rock

paper vs scissors

scissors vs scissors

paper vs scissors

scissors vs scissors

rock vs paper

scissors vs paper

rock vs scissors

paper vs scissors

scissors vs scissors

rock vs scissors

paper vs rock

rock vs rock

paper vs scissors

scissors vs scissors

rock vs rock

paper vs rock

scissors vs scissors

rock vs rock

paper vs rock

scissors vs rock

paper vs rock

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

rock vs rock

paper vs paper

scissors vs rock

rock vs rock

paper vs paper

scissors vs rock

rock vs rock

scissors vs rock

rock vs rock

paper vs paper

scissors vs rock

rock vs scissors

paper vs rock

scissors vs paper

rock vs paper

paper vs rock

rock vs rock

paper vs paper

scissors vs paper

rock vs paper

paper vs paper

scissors vs scissors

paper vs paper

scissors vs paper

rock vs paper

scissors vs rock

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs scissors

rock vs rock

paper vs scissors

scissors vs paper

rock vs paper

paper vs paper

scissors vs rock

rock vs rock

paper vs paper

scissors vs rock

paper vs rock

scissors vs scissors

rock vs rock

paper vs scissors

scissors vs scissors

rock vs rock

paper vs rock

scissors vs rock

rock vs rock

paper vs rock

scissors vs rock

rock vs paper

scissors vs paper

Framm! won 26 games and phillip! won 35 ~ there were 39 ties

phillip! wins!!!

Framm! vs plasmid!

rock vs paper

paper vs scissors

scissors vs paper

paper vs scissors

scissors vs rock

rock vs scissors

paper vs rock

scissors vs rock

rock vs paper

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

paper vs paper

scissors vs rock

rock vs paper

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

paper vs paper

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

paper vs paper

scissors vs rock

rock vs paper

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

paper vs paper

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

scissors vs scissors

Framm! won 3 games and plasmid! won 84 ~ there were 13 ties

plasmid! wins!!!

Framm! vs unreality!

rock vs scissors

paper vs scissors

scissors vs rock

paper vs rock

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

rock vs scissors

scissors vs scissors

rock vs rock

paper vs rock

scissors vs rock

rock vs paper

paper vs rock

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs scissors

paper vs rock

scissors vs rock

paper vs paper

scissors vs rock

rock vs scissors

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs paper

rock vs rock

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs paper

rock vs paper

paper vs scissors

scissors vs paper

paper vs paper

scissors vs rock

rock vs paper

paper vs scissors

scissors vs paper

rock vs paper

paper vs scissors

scissors vs rock

rock vs scissors

paper vs rock

scissors vs rock

rock vs scissors

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

paper vs paper

scissors vs rock

rock vs paper

scissors vs scissors

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs paper

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

paper vs paper

scissors vs rock

rock vs paper

paper vs rock

scissors vs rock

rock vs paper

paper vs scissors

scissors vs paper

rock vs paper

paper vs scissors

scissors vs rock

rock vs paper

scissors vs scissors

Framm! won 19 games and unreality! won 66 ~ there were 15 ties

unreality! wins!!!

Framm! vs dawh!

rock vs rock

paper vs paper

scissors vs scissors

paper vs rock

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

scissors vs paper

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

rock vs scissors

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

paper vs rock

scissors vs rock

rock vs scissors

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs scissors

paper vs paper

rock vs rock

paper vs paper

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

rock vs scissors

scissors vs scissors

rock vs scissors

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

paper vs scissors

scissors vs rock

rock vs scissors

scissors vs scissors

rock vs scissors

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

rock vs rock

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

rock vs scissors

paper vs scissors

scissors vs rock

rock vs scissors

scissors vs scissors

Framm! won 25 games and dawh! won 42 ~ there were 33 ties

dawh! wins!!!

Framm! vs MrApple!

rock vs rock

paper vs paper

scissors vs rock

paper vs paper

scissors vs rock

rock vs rock

paper vs paper

scissors vs rock

rock vs rock

scissors vs paper

rock vs paper

paper vs rock

scissors vs paper

rock vs paper

paper vs paper

scissors vs paper

rock vs rock

paper vs paper

rock vs paper

paper vs rock

scissors vs rock

rock vs rock

paper vs paper

scissors vs paper

paper vs rock

scissors vs paper

rock vs paper

scissors vs rock

rock vs paper

paper vs rock

scissors vs paper

rock vs paper

paper vs rock

rock vs rock

paper vs paper

scissors vs rock

rock vs rock

paper vs rock

scissors vs rock

rock vs rock

paper vs rock

scissors vs paper

paper vs rock

scissors vs paper

rock vs rock

paper vs rock

scissors vs rock

rock vs rock

paper vs rock

scissors vs paper

rock vs paper

paper vs rock

scissors vs rock

rock vs rock

scissors vs rock

rock vs paper

paper vs rock

scissors vs paper

rock vs paper

paper vs paper

scissors vs rock

rock vs rock

paper vs rock

rock vs rock

paper vs rock

scissors vs paper

rock vs paper

paper vs rock

scissors vs rock

paper vs paper

scissors vs rock

rock vs paper

scissors vs rock

rock vs paper

paper vs paper

scissors vs paper

rock vs rock

paper vs rock

rock vs paper

paper vs rock

scissors vs rock

rock vs rock

paper vs paper

scissors vs rock

rock vs rock

paper vs rock

scissors vs rock

paper vs rock

scissors vs rock

rock vs paper

paper vs rock

scissors vs paper

rock vs rock

paper vs rock

scissors vs paper

rock vs paper

paper vs rock

scissors vs paper

rock vs paper

scissors vs rock

Framm! won 37 games and MrApple! won 35 ~ there were 28 ties

Framm! wins!!!

Framm! vs SomeGuy!

rock vs rock

paper vs rock

scissors vs rock

paper vs rock

scissors vs paper

rock vs scissors

paper vs rock

scissors vs paper

rock vs scissors

scissors vs rock

rock vs scissors

paper vs paper

scissors vs rock

rock vs scissors

paper vs paper

scissors vs rock

rock vs scissors

paper vs paper

rock vs rock

paper vs rock

scissors vs rock

rock vs rock

paper vs rock

scissors vs rock

paper vs rock

scissors vs paper

rock vs scissors

scissors vs rock

rock vs scissors

paper vs paper

scissors vs rock

rock vs scissors

paper vs paper

rock vs rock

paper vs rock

scissors vs rock

rock vs rock

paper vs rock

scissors vs rock

rock vs rock

paper vs rock

scissors vs rock

paper vs rock

scissors vs paper

rock vs scissors

paper vs rock

scissors vs paper

rock vs scissors

paper vs rock

scissors vs paper

rock vs scissors

paper vs rock

scissors vs paper

rock vs scissors

scissors vs rock

rock vs scissors

paper vs paper

scissors vs rock

rock vs scissors

paper vs paper

scissors vs rock

rock vs scissors

paper vs paper

rock vs rock

paper vs rock

scissors vs rock

rock vs rock

paper vs rock

scissors vs rock

paper vs rock

scissors vs paper

rock vs scissors

scissors vs rock

rock vs scissors

paper vs paper

scissors vs rock

rock vs scissors

paper vs paper

rock vs rock

paper vs rock

scissors vs rock

rock vs rock

paper vs rock

scissors vs rock

rock vs rock

paper vs rock

scissors vs rock

paper vs rock

scissors vs paper

rock vs scissors

paper vs rock

scissors vs paper

rock vs scissors

paper vs rock

scissors vs paper

rock vs scissors

paper vs rock

scissors vs paper

rock vs scissors

scissors vs rock

Framm! won 57 games and SomeGuy! won 22 ~ there were 21 ties

Framm! wins!!!

Framm! vs jarze!

rock vs rock

paper vs paper

scissors vs scissors

paper vs rock

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

scissors vs paper

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

rock vs scissors

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

paper vs rock

scissors vs scissors

rock vs rock

scissors vs paper

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

rock vs scissors

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

paper vs rock

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

scissors vs paper

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

rock vs scissors

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

paper vs rock

scissors vs scissors

rock vs rock

scissors vs paper

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

rock vs scissors

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

paper vs rock

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

paper vs paper

scissors vs scissors

rock vs rock

scissors vs paper

Framm! won 14 games and jarze! won 0 ~ there were 86 ties

Framm! wins!!!

Link to comment
Share on other sites

  • 0

I know my code doesn't have all the nice comments that plasmid's has, so here is the same code with much more comments added:



else if (algoNum==36) //unreality!

            {

                if (i==0) return SCISSORS; /* people started with ROCK in T1 so most people in T2 started with PAPER, this is to defeat those that start with PAPER or at least tie those who start with SCISSORS */

                if (i==1) return (b[0]+2)%3; /* if they expect me to beat what they played first, I'll beat THAT. This move will only lose if they play the same move twice in a row */

                if (i==2) return (b[1]+2)%3; /* same reasoning */

                // now for my algorithm

                ArrayList<Integer> vooma = new ArrayList<Integer>(50); // create a list to store what you have done recently

                ArrayList<Integer> voomb = new ArrayList<Integer>(50); // create a list to store what the opponent has done recently

                ArrayList<Integer> checka = new ArrayList<Integer>(50); // create a list to store sets of moves of equal size to vooma, from earlier in the game than vooma, to be checked against vooma

                ArrayList<Integer> checkb = new ArrayList<Integer>(50); // create a list to store sets of moves of equal size to voomb, from earlier in the game than voomb, to be checked against voomb

                for (int goback = i / 2; goback > 0; goback--) // start with as large a sequence as possible to try to find an earlier match, but get smaller and smaller until a match is found earlier in the program

                {

                    vooma.clear(); voomb.clear(); // clear both lists

                    for (int kk=i-goback; kk<i; kk++) { vooma.add(a[kk]); voomb.add(b[kk]); } // fill both lists with your recent moves

                    for (int startcheck=0; startcheck< i-goback-1; startcheck++) // try a bunch of possible "checka" and "checkb" lists until/ifever a match is found

                    {

                        checka.clear(); checkb.clear(); // do that by clearing the lists and then

                        for (int jj=startcheck; jj<startcheck+goback; jj++) { checka.add(a[jj]); checkb.add(b[jj]); } // filling the lists

                        if (vooma.equals(checka) && voomb.equals(checkb)) return ((b[startcheck+goback]+1)%3); // if the lists are equal, play what beats what b is predicted to play next

                    }

                }

                // nothing was found to match, so play my last move that won

                for (int zz=i-1; zz>0; zz--) // go from i-1 to round 1 (don't count i=0) backwards and return whatever move has won me a round most recently

                {

                    if ((3 + a[zz] - b[zz]) == 1) return a[zz];

                }

                // no winning moves??? (excluding i=0) // THEN PLAY ROCK!

                return ROCK;

            }


Basically what it does is start by looking at all the code from i/2 to i-1 and look for analogue in the code before that which could help predict what should follow. It's unlikely to find that, so then it checks the code from i/2 +1 to i-1 and sees if there is an analogue among the previous code, etc. It keeps shrinking the size that it looks for... for example, it could get down to i-3, i-2 and i-1 and have found an analogue to those rounds (ie, exactly the same moves in same sequence for a[] and b[]) in rounds, say, 7, 8 and 9. Then it plays whatever beats b[10], predicting b to play that again. This whole process cannot logically be done without a triple nested loop, but they are all time-shrinking loops that reduce when the higher-order ones reduce

Link to comment
Share on other sites

  • 0

Basically what it does is start by looking at all the code from i/2 to i-1 and look for analogue in the code before that which could help predict what should follow. It's unlikely to find that, so then it checks the code from i/2 +1 to i-1 and sees if there is an analogue among the previous code, etc. It keeps shrinking the size that it looks for... for example, it could get down to i-3, i-2 and i-1 and have found an analogue to those rounds (ie, exactly the same moves in same sequence for a[] and b[]) in rounds, say, 7, 8 and 9. Then it plays whatever beats b[10], predicting b to play that again. This whole process cannot logically be done without a triple nested loop, but they are all time-shrinking loops that reduce when the higher-order ones reduce

Looks like we had kind of the same philosophies in mind, but different approaches to it.

For the other algorithms, do you still have the "English" descriptions of how they're supposed to work?

Also, how about seeing how the T2 defeater does against all of these algorithms? I wonder if it really does give any indication of how "novel" the strategies are.

Edited by plasmid
Link to comment
Share on other sites

  • 0

Looks like we had kind of the same philosophies in mind, but different approaches to it.

For the other algorithms, do you still have the "English" descriptions of how they're supposed to work?

which algorithms? Most of them I did not write - of the 8 in T3 competition, I only wrote mine and (technically jarze's but way earlier) and Mr Apple's:


else if (algoNum==41) //MrApple!

            {

                String convert = "Rock Paper Scissors";

                char[] car = convert.toCharArray();

                return ((car[i/8] >>> (7 - (i % 8))) % 2);

            }

He just wanted text converted from ASCII into binary and then taken from as 0s and 1s to use as ROCK/PAPER... java uses Unicode, not ASCII, so I had to convert that and then use bitshifts and modulus to extract the binary 0/1 out of it... it was actually pretty tough but it was mostly math. As for any of the other algos, you'll have to ask the ones that made them :thumbsup:
Also, how about seeing how the T2 defeater does against all of these algorithms? I wonder if it really does give any indication of how "novel" the strategies are.

Final Results:

T2 defeator vs phillip!: T2 defeator wins!!!

T2 defeator vs plasmid!: plasmid! wins!!!

T2 defeator vs unreality!: T2 defeator wins!!!

T2 defeator vs dawh!: T2 defeator wins!!!

T2 defeator vs MrApple!: T2 defeator wins!!!

T2 defeator vs Framm!: T2 defeator wins!!!

T2 defeator vs SomeGuy!: T2 defeator wins!!!

T2 defeator vs jarze!: T2 defeator wins!!!

phillip! vs plasmid!: plasmid! wins!!!

phillip! vs unreality!: unreality! wins!!!

phillip! vs dawh!: dawh! wins!!!

phillip! vs MrApple!: phillip! wins!!!

phillip! vs Framm!: phillip! wins!!!

phillip! vs SomeGuy!: phillip! wins!!!

phillip! vs jarze!: jarze! wins!!!

plasmid! vs unreality!: plasmid! wins!!!

plasmid! vs dawh!: plasmid! wins!!!

plasmid! vs MrApple!: plasmid! wins!!!

plasmid! vs Framm!: plasmid! wins!!!

plasmid! vs SomeGuy!: plasmid! wins!!!

plasmid! vs jarze!: plasmid! wins!!!

unreality! vs dawh!: unreality! wins!!!

unreality! vs MrApple!: unreality! wins!!!

unreality! vs Framm!: unreality! wins!!!

unreality! vs SomeGuy!: unreality! wins!!!

unreality! vs jarze!: unreality! wins!!!

dawh! vs MrApple!: dawh! wins!!!

dawh! vs Framm!: dawh! wins!!!

dawh! vs SomeGuy!: dawh! wins!!!

dawh! vs jarze!: dawh! wins!!!

MrApple! vs Framm!: Framm! wins!!!

MrApple! vs SomeGuy!: MrApple! wins!!!

MrApple! vs jarze!: jarze! wins!!!

Framm! vs SomeGuy!: Framm! wins!!!

Framm! vs jarze!: Framm! wins!!!

SomeGuy! vs jarze!: It was a tie!!!



Win Count:

T2 defeator: 7.0

phillip!: 3.0

plasmid!: 8.0

unreality!: 6.0

dawh!: 5.0

MrApple!: 1.0

Framm!: 3.0

SomeGuy!: 0.5

jarze!: 2.5



Type y for analysis y



[Algos: 9] [Games: 36] [Average Score: 4.0] [Sdev: 2.483] [MAD: 2.222]


From Greatest to Least:

       plasmid!: 8.0       [505 wins, 152 ties, 143 losses] 11.557

    T2 defeator: 7.0       [492 wins, 155 ties, 153 losses] 10.547

     unreality!: 6.0       [471 wins, 147 ties, 182 losses] 10.013

          dawh!: 5.0       [307 wins, 203 ties, 290 losses]  7.351

       phillip!: 3.0       [229 wins, 251 ties, 320 losses]  4.114

         Framm!: 3.0       [200 wins, 236 ties, 364 losses]  2.991

         jarze!: 2.5       [140 wins, 249 ties, 411 losses]  3.021

       MrApple!: 1.0       [191 wins, 273 ties, 336 losses]  1.380

       SomeGuy!: 0.5       [123 wins, 218 ties, 459 losses]  0.000


The biggest blowout game(s) was(were): 

T2 defeator won 100 games and SomeGuy! won 0 ~ there were 0 ties



Type y to play again n


Thanks for playing!


Link to comment
Share on other sites

  • 0

Wow, I wasn't expecting the T2 defeator to do THAT well against a bunch of algorithms that it wasn't specifically trained to beat! It looks like only Jarze's was the same, and dawh's was similar but did have changes. Maybe learing to beat a lot of specific approaches ends up producing an strategy that's good in a generalized situation, the win/loss margin makes it seem like it was more than just luck.

Link to comment
Share on other sites

  • 0

I did want to give a brief outline of how mine works, as I thought it was pretty creative.

basically, segment the moves into two partitions, select the segment where my opponent has won the most.

keep doing so until you get to a single element. play my opponent's move.

Link to comment
Share on other sites

  • 0

Sorry I've been dead forever! I've no idea what's going on around here, I hope it's all good. This is only a brief hiatus from my sleep from this forum (I will probably return for real once Changes comes out and the Jim Butcher forums lose their grip on me), I'm just popping in to say hi! and bye!

Link to comment
Share on other sites

  • 0

so, here's the preliminary code:


import java.util.Scanner;

import java.util.Random; // for use only in the "rand" test program!

public class rpsslcontest

{


public static final int ROCK = 0;

public static final int PAPER = 1;

public static final int SCISSORS = 2;

public static final int SPOCK = 3;

public static final int LIZARD = 4;

public static final int ROUNDS = 100;


   public static int rpsslgo(int algoNum, int i, int[] a, int[] b)

   {


    public static String conv(int yeah)

    {

        if (yeah==ROCK) return "  rock  ";

        if (yeah==PAPER) return " paper  ";

        if (yeah==SCISSORS) return "scissors";

        if (yeah==SPOCK) return "spock";

        if (yeah==LIZARD) return "lizard";

        return "you've got a problem";

    }


   public static void main(String[] args)

   {



            // round robin system:

            String[] names = { " " };

            int[] algos = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; 

            String financ = "";

            int n = algos.length;  int[] nw = new int[n];

            int numGames = n/2 * (n - 1);

            for (int nn=0; nn<n; nn++)

            {

                for (int nnn = nn+1; nnn<n; nnn++)

                {

                    // game between algos[nn] and algos[nnn]

                    int algo1 = algos[nn]; int algo2 = algos[nnn];


                    System.out.print("\n\n"+names[algo1]+" vs "+names[algo2]+"\n");


                   int[] ar1 = new int[ROUNDS];

                   int[] ar2 = new int[ROUNDS];


                   int[] wins = new int[ROUNDS];


                   for (int k=0; k<ROUNDS; k++)

                   {

                           ar1[k] = rpsslgo(algo1, k, ar1, ar2);

                           ar2[k] = rpsslgo(algo2, k, ar2, ar1);

                           wins[k] = (5 + ar1[k] - ar2[k]) %5;

                           // 0 -> tie

                           // odd -> ar1 wins

                           // even >0 -> ar2 wins

                   }


                   int oneWins=0; int twoWins=0;

                   for (int l=0; l<ROUNDS; l++)

                   {

                       System.out.println(conv(ar1[l]) + " vs " + conv(ar2[l]));

                       if(wins[l] > 0){

                          if (wins[l]%2 == 1) { oneWins++; }

                          if (wins[l]%2 == 0) { twoWins++; }

                       }

                    }

                    int ties = ROUNDS - oneWins - twoWins; String msg;

                    if (oneWins > twoWins) { msg = names[algo1]+" wins!!!"; nw[nn]++; }

                    else if (twoWins > oneWins) { msg = names[algo2]+" wins!!!"; nw[nnn]++; }

                    else msg = "It was a tie!!!";

                    System.out.println("\n"+names[algo1]+" won "+oneWins+" games and "+names[algo2]+" won " +twoWins+ " ~ there were " + ties + " ties");

                    System.out.println(msg);

                    financ += (names[algo1]+" vs "+names[algo2] + ": " + msg + "\n");

                }

            }

            System.out.print("\n\nFinal Results:\n" + financ + "\n\nWin Count:");

            for (int abc=0; abc<n; abc++) System.out.println(names[algos[abc]]+": "+nw[abc]);

        }


}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...