PRO|STAMINA

  • 3 Replies
  • 2251 Views
*

Zero

  • Eve
  • ***********
  • 1287
PRO|STAMINA
« on: January 05, 2018, 09:45:09 am »
 
Hi,

I've just realized that I forgot to drop a link to a pet programming game I made several months ago 

It's called PRO|STAMINA. It's a tennis themed betting game where two programs compete in duels.

The program that makes the best predictions of the other program's behavior wins the game. So... who has the deepest learning algorithm?

Tell me what you think. http://pro-stamina.atspace.eu/

*

Zero

  • Eve
  • ***********
  • 1287
Re: PRO|STAMINA
« Reply #1 on: January 05, 2018, 10:01:26 am »
Here are 3 bots to start with.

Kickass.js
Code
var previous = [0,'Love',0,0,'Love',0];

var opGameplay = {};

var myComment = 'Go!';


onmessage = function(e) {

   
    var workerResult;
 
    if (e.data=='play') { workerResult = 2; } else {

        learn(e);
       
        previous = [
            e.data.me.force,
            e.data.me.point,
            e.data.me.game,
            e.data.opponent.force,
            e.data.opponent.point,
            e.data.opponent.game
        ];
       
        myComment = ' ';
       
        var opGuess = guess();
       
        if (opGuess > 5) {
           
            workerResult = 1;
           
        } else {
           
            workerResult = opGuess+1;
           
        }       
    }
   
    postMessage(workerResult+myComment);
}



function learn(e) {
   
    for (var i=0; i<6; i++) {
   
        var situation = e.data.opponent.force+'<='+i+'=='+previous[i];
       
        if (!opGameplay[situation]) {
           
            opGameplay[situation] = 1;
           
        } else {
           
            opGameplay[situation] += 1;
           
        }
    }
}



function guess() {
   
    var best = 0;
    var bestValue = 0;
    var value;

    for (var testForce=1; testForce<10; testForce++) {
       
        value = 0;
   
        for (var i=0; i<6; i++) {
           
            var situation = testForce+'<='+i+'=='+previous[i];
           
            if (opGameplay[situation]) { value += opGameplay[situation]; }
           
        }
       
        myComment += '['+testForce+']='+value+', ';
       
        if (value >= bestValue) {
           
            bestValue = value;
           
            best = testForce;
           
        }
    }   
   
    return best;
}

Smartass.js
Code
onmessage = function(e) {

  var myComment = '';

  var workerResult;
 
  if (e.data=='play') { workerResult = "1"; } else {
     
      workerResult = e.data.opponent.force+1;
 
      if (e.data.me.force > e.data.opponent.force) { myComment = "Wooo yeah!"; } else { myComment = "ok..."; }
  }
 
  postMessage(workerResult+' '+myComment);
}

Randy
Code
onmessage = function(e) {

  var workerResult = 1+(Math.random()*3);
  postMessage(workerResult+' '+Math.floor(10000000*Math.random()));
}

*

ivan.moony

  • Trusty Member
  • ************
  • Bishop
  • *
  • 1722
    • mind-child
Re: PRO|STAMINA
« Reply #2 on: January 05, 2018, 12:03:21 pm »
I like the graphic design.

*

Zero

  • Eve
  • ***********
  • 1287
Re: PRO|STAMINA
« Reply #3 on: January 05, 2018, 02:27:27 pm »
Thanks! I tried something futuristic... green from The Matrix, blue from Tron, and red from Roland Garros.  ;)

So... can you beat Kickass.js gentlemen?

 


Say good-bye to GPUs...
by MikeB (AI News )
March 23, 2024, 09:23:52 am
OpenAI Speech-to-Speech Reasoning Demo
by MikeB (AI News )
March 15, 2024, 08:14:02 am
Google Bard report
by ivan.moony (AI News )
February 14, 2024, 04:42:23 pm
Elon Musk's xAI Grok Chatbot
by MikeB (AI News )
December 11, 2023, 06:26:33 am
Nvidia Hype
by 8pla.net (AI News )
December 06, 2023, 10:04:52 pm
How will the OpenAI CEO being Fired affect ChatGPT?
by 8pla.net (AI News )
December 06, 2023, 09:54:25 pm
Independent AI sovereignties
by WriterOfMinds (AI News )
November 08, 2023, 04:51:21 am
LLaMA2 Meta's chatbot released
by 8pla.net (AI News )
October 18, 2023, 11:41:21 pm

Users Online

287 Guests, 0 Users

Most Online Today: 335. Most Online Ever: 2369 (November 21, 2020, 04:08:13 pm)

Articles