Apr 29, 2012

Scissors Paper Rock Robot

Here is a really interesting robot that plays Scissors, Paper, Rock.  

While the construction is pretty straightforward (3 levers that represent each of the options), the real intelligence happens behind the scenes.  This robot actually learns the rules of the game as it goes along.


"This robot does not play rock-paper-scissors in the way people play.  It first asks the user to input a move (either rock - paper - or scissors).  The robot then calculates the best move to play, and then will extend a retractable arm that shows its next move (a Lego rock, paper, or a Lego scissors).  The player must then tell the robot if the robot won, lost, or tied, against the player.  
While you may think that this robot is cheating, since it waits for the player to make a move, I did not program the robot to know the rules of the game!  The robot does not know that rock beats scissors, paper beats rock, or scissors beats paper!  Instead, the robot relies on the player to tell whether it won/lost/tied to learn from past success/failures and to use this information in the future!"

It looks like after around 10 rounds, the robot has enough information to successfully know the correct move to play for anything its opponent gives it.

The Instructable gives a very good description as well about the theory behind it and how it calculates the best move.  I love the fact that the robot is rewarded with a virtual point if it wins, but penalised 10,000 points if it loses or ties. (talk about incentive!)

Full Instructable here (including source code in NXC) - http://www.instructables.com/id/Self-Learning-Rock-Paper-Scissors-Robot-from-L/

2 comments:

rcxking said...

Wow I didn't expect my robot to featured on the NXT Step :D BTW I'm the guy who sent the link about NXT-G being #20 on the TIOBE Index.

Gunther Cox said...

Quite cool. There is some good programming logic there.

Related Posts Plugin for WordPress, Blogger...