Share your repls and programming experiences

← Back to all posts
THIS PROGRAM GUESSES THE NUMBER YOU PICKED
OldWizard209

You pick a number, keep it in your mind. You won't be asked for the number. The program is then gonna ask you a few questions. Answer them and using math, it will guess your number.

ENJOY :)

Voters
LegendaryWolf
KobeFF
AlphaPro69
xxXyeetmaster69
Arctis
mesquite2234
KeenanBusch
18180
angrydoge
zplusfour
Comments
hotnewtop
BrokenVessel101

Yeah its really cool how youve done this. To figure it out you take the first number in each of the lists you said yes to and add them together. Well done for putting it into code :)

OldWizard209

Kinda like dat @BrokenVessel101

angrydoge

boi. 15 on tha dot

OldWizard209

Thnx :D @dabombdgdzjr

Krazy0range

Nice! The list stuff is cool!

OldWizard209

Oh Thanks :) @KrazyOrange

Aivoybia

???

[deleted]

it didnt guess my number for 6 attempts

OldWizard209

no offence but is is Not possible . @BRUHIP

OldWizard209

might be a mistake from ur side? @BRUHIP

finnsterfran

Awesome!

OldWizard209

UMMMMM........ THANKS :D @finnsterfran

TriLamTruong

Wow it works for me (cool stuff :D)

OldWizard209
mesquite2234

Im an idiot. I thought of 67

OldWizard209
CadenGamble

does not work for me at all

OldWizard209

U have to enter yes or no ONLY @CadenGamble

CadenGamble

@abdullahrajput9 thats weird tho in the code it has both in the if statment

OldWizard209

Yes I changed it yesterday @CadenGamble

CadenGamble

@abdullahrajput9 oh ok when i was messing with this the other day it had them both in the if statement unless you fixed but that makes sense

OldWizard209

Yeah and I guess I didn't change for all of the statements cuz I was too lazy to just copy paste the code XD @CadenGamble

CadenGamble

@abdullahrajput9 thats fair lol

OldWizard209
[deleted]

yeah the same as @Bookie0 said

import sys, os, curses
import time

And this is the code:

st = 0.04
def sp(str):
for letter in str:
sys.stdout.write(letter)
sys.stdout.flush()
time.sleep(st)
print()

Bookie0

@ConorTseng lol why did you just copy what I wrote lol

[deleted]

@Bookie0 it was just a joke

Bookie0
[deleted]

i picked 2. 0 wasn't even in the list at all

OldWizard209

It dosent have to be in all the lists that is why i am asking u if the number is in the list or no. And BTW u have to write yes or no not just y or n @AJDevelopment

Bookie0

For slowprint, you should make it in a function:

I usually put it at 0.04 because it prints it not too fast and not too slow. But you can change it. Just change the value after st

Each time you want to do this typewriter effect, just do:

;)

OldWizard209

I know I can make a function but after it was done i was too lazy to change it :) Thanks for the suggestion tho @Bookie0

Bookie0

ok np! :) @abdullahrajput9

OldWizard209

OK @Bookie0 I was kinda itching by looking at my code being soo ugly so I will change it to a function.

SOON.......

OldWizard209

Changed, Thanks a lot to you :) @Bookie0

Bookie0

lol cool! :) @abdullahrajput9

Bookie0
OldWizard209
Bookie0
PlazmaDolphin

i tried for 2 and it said my number was 0.
what???

OldWizard209

NGL, this program dosen't fail so u must have entered the wrong answers @PlazmaDolphin

PlazmaDolphin

@abdullahrajput9
oh yeah i said y and n instead of yes and no that must have been it... sorry!

OldWizard209

Yup unfortunately it dosent accept y and n so lemme change it @PlazmaDolphin

Jeydin21

Bruh. You should choose trickery as your major, legit

OldWizard209

I call it MATH @Jeydin21
AND BTW I am only 12 so i cant pick a major :(

[deleted]

@abdullahrajput9 doesn't the repl.it TOS say 13+ (i am not a moderator so i can't do anything about this)

OldWizard209

UMMM actually i am turning 13 in December @AJDevelopment

Jeydin21

@AJDevelopment Well, I'm pretty sure that there are some other very good coders on repl.it who posts regularly in Repl Talk that are under 13.

Jeydin21

@AJDevelopment Also I don't think Repl.it would limit their services to 13 and older because coding is supposed to be available to everyone regardless of their age.

ThisUserTaken

here's how you did it. It's WAY EASIER to understand if I made the list shorter. The list and yes or no questions are part of the trick in this program. Let's say I asked you to have a number in this list [1, 2, 3, 4, 5, 6]. Let's say you chose 2. The first question he asks is even or prime by asking if the number is in this list [1, 3, 5]. this already halves the chance of our answer. We say no. He now knows that it is an even number. He mixes it a little by asking whether it is in this list [1, 4, 5] (changed some numbers). You say no. Ok, now he knows its an even number that is not 4. The final question: [1, 2, 4]. Is it in this? He already knows it isnt 4 and 1, so if you say yes, its 2 but if you say no, its 6! You say yes and the number is determined as 2! Tricky, yet simple!

OldWizard209

Ok YOU ARE BIG BRAIN @ThisUserTaken

ThisUserTaken
ThisUserTaken

@abdullahrajput9 i like math too

adl212

@ThisUserTaken Time for me to make sure the program can't guess my number!

ThisUserTaken

@adl212 oh. it will if you answer correctly. the math works that way.

adl212

@ThisUserTaken Yup. unfortunately

OldWizard209

Lol @adl212

ThisUserTaken

trying to twist it up huh? but still good job using logical reasoning!

OldWizard209

LOL I am not twisting it up, I am just analysing the data u provide and giving an answer based on that @ThisUserTaken

ThisUserTaken

@abdullahrajput9 ik look at my other comment. i mean your kinda twisting with the list questions.

OldWizard209

I know but thats what the program is made for ;) @ThisUserTaken

ThisUserTaken

@abdullahrajput9 ye. good job!

OldWizard209
Stan085

Eh, its ok, i guess i'll upvote :)

OldWizard209

Thanks @Stan085

JBloves27

Nice job!

CoolJames1610

gg

oboy12
DodgerXX

that really really good ngl

OldWizard209

Thnx @DodgerXX

duyanhle

nice work done ! Real cool

OldWizard209
JasonLiu19

how??? it guessed my number (think that's the point but whatever)

OldWizard209

LOL @JasonLiu19
Its a simple math if you take it into consideration but the math is tricky, so you have to LOVE math to understand this

ThisUserTaken

@JasonLiu19 look at my comment. Also, the Pokemon Battle game I made was by me. It was 1 month and 13 days older than that other person's. I have more evidence if you think I'm lying. -_-

OldWizard209

Umm I dont get what u mean there @ThisUserTaken

ThisUserTaken

@abdullahrajput9 its a long story. he accused me of copying someone else's program, but it was the other way around. That person forked my repl after 1 month and 13 days of I creating it. Sorry if you got a little confuzzled.

ThisUserTaken

@abdullahrajput9 here's the post he said I "copied" https://repl.it/talk/share/Pokemon-Battle/59696. if you look at my repls and the other guys one. his is the exact same copy but created 1 month after I finished, so I was saying he forked mine instead of I copying him.

JasonLiu19

@ThisUserTaken never said you copied, was trying to find out who copied who(the guy is in one of my classes) and was suspicious because a.he was not doing well in that class and b.he is in 6th grade

ThisUserTaken

@JasonLiu19 i am sorry for misunderstanding you lol. I thought you were on his side. Sorry for causing this trouble!

ThisUserTaken

@JasonLiu19 ye. i really wish it said who forked who. I created that 6 months ago and started repl 3 months ago

MocaCDeveloper

That is pretty cool not gonna lie!

OldWizard209
MocaCDeveloper

@abdullahrajput9

I honestly would've never had the brains to figure out how to do it. Good job!

NoNameByProgram

did you just copy a post...that's trending...?

OldWizard209

NOOOO This is a completely different program LMAO @NoNameByProgram
I made it

OldWizard209

See it again @NoNameByProgram

NoNameByProgram

@abdullahrajput9 why did you steal some code for no reason?

NoNameByProgram

@abdullahrajput9 i saw it again. why did you have to edit it

OldWizard209

It was a mistake, This program and the trending one were side by side so I mistakenly clicked that one. I than had to edit it after seeing ur comment @NoNameByProgram

OldWizard209

LOL BTW I made BOTH @NoNameByProgram