Share your repls and programming experiences

← Back to all posts
Rock paper scissors, with self learning ai.

Credits to Cássio Zen for the neural network. (the only reason this works)
find the source here:

Type r for rock, p for paper, and s for scissors.
The ai will slowly learn how to win.

This really isn't that impressive because it knows what you chose but I just wanted to make something that can learn quickly and easily.

edit: I edited the code now so that when it loses it sees it as really bad. So this should make it learn better. (I guess like more of a punishment/reward)

MrEconomical (2304)

a neural network that isnt garbage

  • E
ColinDaniels (2)

First, I'd like to say that you did a really good job on this, second, of course you can use other people's code. The 'Talk' Section is meant to share code so others can use and build off of it as well as show off what you made


@ColinDaniels Thanks!
Also yeah, I kind of figured it was fine but I just wanted to make sure.

RayvelArjoon (88)

I lost on the second go

InfInItel (1)

Lua? The first time I've ever seen someone use Lua except for Roblox.

Foster_Bryant (89)

how do i get into neural networks with python?


I only know the very basics of python but these seem like some good resources to look at:

If you are looking to fully build a nn on your own I would recommend doing research on how they work if you haven't already.

Foster_Bryant (89)

@CoolestDoggo are neural networks similar to deep learning?


@Foster_Bryant Deep learning is someone that teaches itself with no human intervention.
This is what most big companies do for ai but this is just a simple one.
edit: For clarification, deep learning is made up of multiple neural networks that basically go against each other. They will start to learn better ways to do things from random mutations and changes.

Foster_Bryant (89)

@CoolestDoggo oh. how would I go about making a basic stock prediction neural network? just the concept

TurtleAndrew (211)

@Foster_Bryant try using "Tensor Flow" aka googles AI for python, works really good.

Foster_Bryant (89)

@TurtleAndrew ok ill look into it when I get out of school thanks


When I put in the same option, such as 'scissors' the AI doesn't learn that rock beats scissors. It just keeps putting down paper, and never learns. I think there's a problem here.


@IreoluwaRaufu It was set to learn "slower" to avoid mistakes in learning, I changed it so it should learn faster and be a bit smarter.


@CoolestDoggo Oh. OK. That makes sense. other than that, this is really impressive \(0.0)/

idonteatcats (7)

the ai just pick up on the input and matches it maybe make the ai pick the winning object and not the same object


@idonteatcats I dont control what it picks, it learns on its own from playing with you.