rpsls-bot.git
descriptionRock Paper Scissors Lizard Spock - playing bot "offline"
last changeSun, 4 Feb 2018 20:09:55 +0000 (21:09 +0100)

Rock-Paper-Scissors-Lizard-Spock

A simple bot to play this game, following ideas from this article.

The rules are given by Sheldon in episode 8 of season 2 of TBBT (The Big Bang Theory).


Online demo

Winning should be difficult after a few dozens of rounds, because it’s hard to play at random.

Setting “winner bot” and/or increasing memory can improve bot level.


Technical details

Each potential choice is linked to all outputs in a (neural) network, for each input in memory. We thus have size of memory x (number of choice)2 links. To select a move, the bot computes the sum of all links weights from an activated choice (that is to say, the value of a memory cell) to each output. The output with biggest weights sum wins: the move is played.

The reward is then determined from human move: -1 for a loss, 0 for a draw (except if “winner bot” is selected, in which case a draw = a loss) and 1 for a win. Weights on the active links are updated positively or negatively depending on reward sign. All weights are initialized to zero, and since some time is required for learning the first moves in the game would be quite random.

See RPS_network_2.svg file for an illustration with memory=2 and simple RPS.

shortlog
2018-02-04 Benjamin AuderBetter hints on mousehover master
2018-02-04 Benjamin AuderAdd some explanations, improved styles
2018-01-25 Benjamin AuderBetter README, add technical details
2018-01-25 Benjamin AuderBetter messages in case of draw
2018-01-25 Benjamin AuderClarify controls meaning
2018-01-24 Benjamin AuderFix bug when entering nInput
2018-01-24 Benjamin Auderadjust Spock height
2018-01-24 Benjamin Audercosmetics
2018-01-24 Benjamin AuderLink to github from index.html
2018-01-24 Benjamin AuderFix typo in README
2018-01-24 Benjamin AuderChange README
2018-01-24 Benjamin AuderDebug, add README and images, ready for publish
2018-01-24 Benjamin Auderdebug attempt with simple RPS
2018-01-24 Benjamin AuderFix typos, change ftype to unix. Almost working
2018-01-24 Benjamin AuderFirst draft
heads
6 years ago master