Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


[Python] Guess your number filter_list
Author
Message
RE: [Python] Guess your number #11
(02-09-2013, 04:23 PM)chmod Wrote: I could do but you stated you didn't want anything like the guess the number game and with this being so similar I din't think you'd want it


is it 2?

No, I only said you won't get 500 points for it as it is not worth so much. You may get 200 for that. Biggrin

No. Higher.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: [Python] Guess your number #12
(02-09-2013, 04:23 PM)chmod Wrote: I could do but you stated you didn't want anything like the guess the number game and with this being so similar I din't think you'd want it


is it 2?

No, I only said you won't get 500 points for it as it is not worth so much. You may get 200 for that. Biggrin

No. Higher.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply

RE: [Python] Guess your number #13
fair enough I'll enter it in then


8
tries:2
If you need help feel free to PM me
[Image: klfpJD]
Probitcoin
Freebitcoin
BTC clicks
bitcoin wallet:
1FBPAanbs3rJU9BUpobpDJc9hHUaCaC25N

Reply

RE: [Python] Guess your number #14
fair enough I'll enter it in then


8
tries:2
If you need help feel free to PM me
[Image: klfpJD]
Probitcoin
Freebitcoin
BTC clicks
bitcoin wallet:
1FBPAanbs3rJU9BUpobpDJc9hHUaCaC25N

Reply

RE: [Python] Guess your number #15
fair enough I'll enter it in then


8
tries:2
If you need help feel free to PM me
[Image: klfpJD]
Probitcoin
Freebitcoin
BTC clicks
bitcoin wallet:
1FBPAanbs3rJU9BUpobpDJc9hHUaCaC25N

Reply

RE: [Python] Guess your number #16
Code:
low = 0
high = 100
ans = (high + low)/2

print("Please think of a number between 0 and 100!")

while True:
        
    print("Is your secret number "+str(ans)+"?")
        
    x = raw_input("Enter 'h' to indicate the guess istoo high. \
Enter 'l' to indicate the guess is too low. \
Enter 'c' to indicate I guessed correctly. ")

    if x == 'h':
         high = ans
    elif x == 'l':
         low = ans
    elif x == 'c':
         break
    else:
        print("Sorry, I did not understand your input.")
        
    ans = (high + low)/2


print("Game over. Your secret number was: "+str(ans))

I think this is a good way as well, instead of random I use bisection search, - in this program I do not count the tries but I can write it in if it's necessary - . I'm a newbie so correct me if I'm wrong, but using this method will get the guessed number faster sometimes.Wink
I wasn't a hacker for the money, and it wasn't to cause damage.
~ Kevin Mitnick

Reply

RE: [Python] Guess your number #17
Code:
low = 0
high = 100
ans = (high + low)/2

print("Please think of a number between 0 and 100!")

while True:
        
    print("Is your secret number "+str(ans)+"?")
        
    x = raw_input("Enter 'h' to indicate the guess istoo high. \
Enter 'l' to indicate the guess is too low. \
Enter 'c' to indicate I guessed correctly. ")

    if x == 'h':
         high = ans
    elif x == 'l':
         low = ans
    elif x == 'c':
         break
    else:
        print("Sorry, I did not understand your input.")
        
    ans = (high + low)/2


print("Game over. Your secret number was: "+str(ans))

I think this is a good way as well, instead of random I use bisection search, - in this program I do not count the tries but I can write it in if it's necessary - . I'm a newbie so correct me if I'm wrong, but using this method will get the guessed number faster sometimes.Wink
I wasn't a hacker for the money, and it wasn't to cause damage.
~ Kevin Mitnick

Reply

RE: [Python] Guess your number #18
Code:
low = 0
high = 100
ans = (high + low)/2

print("Please think of a number between 0 and 100!")

while True:
        
    print("Is your secret number "+str(ans)+"?")
        
    x = raw_input("Enter 'h' to indicate the guess istoo high. \
Enter 'l' to indicate the guess is too low. \
Enter 'c' to indicate I guessed correctly. ")

    if x == 'h':
         high = ans
    elif x == 'l':
         low = ans
    elif x == 'c':
         break
    else:
        print("Sorry, I did not understand your input.")
        
    ans = (high + low)/2


print("Game over. Your secret number was: "+str(ans))

I think this is a good way as well, instead of random I use bisection search, - in this program I do not count the tries but I can write it in if it's necessary - . I'm a newbie so correct me if I'm wrong, but using this method will get the guessed number faster sometimes.Wink
I wasn't a hacker for the money, and it wasn't to cause damage.
~ Kevin Mitnick

Reply

RE: [Python] Guess your number #19
Not bad as the old saying goes there's more than one way to skin a cat the only thing is you got
Code:
if x == 'h':
         high = ans
    elif x == 'l':
         low = ans

the wrong way around it should be:
Code:
if x == 'h':
         low = ans
    elif x == 'l':
         high = ans

It's always nice to see other people's aproach to somthing though


EDIT

disregard that I see what you did now you mean state if he guess was low or high no he direction the program needs to go
If you need help feel free to PM me
[Image: klfpJD]
Probitcoin
Freebitcoin
BTC clicks
bitcoin wallet:
1FBPAanbs3rJU9BUpobpDJc9hHUaCaC25N

Reply

RE: [Python] Guess your number #20
Not bad as the old saying goes there's more than one way to skin a cat the only thing is you got
Code:
if x == 'h':
         high = ans
    elif x == 'l':
         low = ans

the wrong way around it should be:
Code:
if x == 'h':
         low = ans
    elif x == 'l':
         high = ans

It's always nice to see other people's aproach to somthing though


EDIT

disregard that I see what you did now you mean state if he guess was low or high no he direction the program needs to go
If you need help feel free to PM me
[Image: klfpJD]
Probitcoin
Freebitcoin
BTC clicks
bitcoin wallet:
1FBPAanbs3rJU9BUpobpDJc9hHUaCaC25N

Reply







Users browsing this thread: 1 Guest(s)