Share your repls and programming experiences

← Back to all posts
26
Rock Paper Scissors with Smart AI player

Please open it on repl.it itself at the top right, alot of stats will be shown like win rate, win streaks, and things like the % where u use "Rock" for example.

You will be asked to state the number of matches you want to play with the AI, after the [no. of matches] you could continue or quit if you wish. Pick "1" for Rock, "2" for Scissors and "3" for paper.

Please give some feedback to my AI after experiencing it. Thanks and have fun!

This is one of my first code i created every since i learned python, i hope you enjoy.

P.S Try not to look at the code as it gives away the AI's coding
P.S.S Try to play "seriously" for better AI experience, imagine that the AI is a human you are facing, play about 10-20 matches so that the AI have time to learn your style.

Here is my friend's score against the AI after 30 matches with it

It may not look that exciting, however my friend is really smart and have made reasonable and logical choices for all 30 matches, so you can expect the AI to be difficult (The numbers scares me because it was clearly evident that the AI was on par as him when looking at the datas, further matches may eventually resulted a loss to him as the AI would learn even more)

Commentshotnewtop
2

A rather smart AI, it really makes you think hard about your next play though it may just be a simple RPS game

0

@DenisWhitehead Thanks for the compliment!

2

you know you can just do

import replit
replit.clear()

to clear console

1

@minx28 oh i see thanks, sorry im new to coding and python is my first programming language im currently learning now

1

This brings back memories to one of my oldest programs.

+1 For nostalgia. (even though I made that like only a year ago lol)

1

Well done AI -- and I like that you kept track (and displayed) stats. Made it more enjoyable!

1

@themaka Thanks for appreciating it!

0

not bad but wait until you see my AI toaster

1

@annojia XD Thanks! We shall see..

1

Nice, well done!! I played it 5 x 10 matches, and only won it 2 times haha! It's impressive :)