Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #57965

Re: Help with guessing game :D

Newsgroups comp.lang.python
Date 2013-10-29 12:55 -0700
References (9 earlier) <326cd185-06ba-4c59-b495-c04a9b2dc43b@googlegroups.com> <0a99d12f-e711-4a05-854d-19dfa65c1d8c@googlegroups.com> <8dbd7273-75fe-4a8c-a156-26131a0934e9@googlegroups.com> <bc5ed6c3-5b19-40e7-bee8-3aeed77038c4@googlegroups.com> <13e7590e-402c-43d2-aa21-89aa7bf97606@googlegroups.com>
Message-ID <efa498ed-fb6c-44f8-ba81-9ed2193b1eb9@googlegroups.com> (permalink)
Subject Re: Help with guessing game :D
From rurpy@yahoo.com

Show all headers | View raw


On Tuesday, October 29, 2013 1:03:00 PM UTC-6, Robert Gonda wrote:
> never mind you was right, for some reason I had version 2.7 :/ ,
> and btw I was wondering, is it also possible to make it more
> complex? such as if the computer will again show ā€œYā€ if a digit
> is correct but if a digit is incorrect it will say "H" as in
> too high or ā€œLā€ if it's too low? (while still keeping "Y").
> Do tell me if it sounds confusing :/

Sure it's possible.  What do you think would happen if you 
replaced the code that compares the digits and prints Y or
N with with something like this?

  if guess_str[i] > number_str[i]: print ("H", end='')
  if guess_str[i] < number_str[i]: print ("L", end='')
  if guess_str[i] == number_str[i]: print ("Y", end='')

(you are comparing 1-character long strings containing a
digit between "0" and "9" but they will compare the same 
way numbers do.)

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 04:45 -0700
  Re: Help with guessing game :D Chris Angelico <rosuav@gmail.com> - 2013-10-29 22:53 +1100
    Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 04:54 -0700
      Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 05:05 -0700
        Re: Help with guessing game :D Alister <alister.ware@ntlworld.com> - 2013-10-29 12:58 +0000
          Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 06:03 -0700
            Re: Help with guessing game :D Alister <alister.ware@ntlworld.com> - 2013-10-29 13:07 +0000
              Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 06:10 -0700
                Re: Help with guessing game :D Alister <alister.ware@ntlworld.com> - 2013-10-29 14:25 +0000
                Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 07:40 -0700
                Re: Help with guessing game :D Alister <alister.ware@ntlworld.com> - 2013-10-29 16:19 +0000
                Re: Help with guessing game :D Neil Cerutti <neilc@norwich.edu> - 2013-10-29 17:22 +0000
                Re: Help with guessing game :D rusi <rustompmody@gmail.com> - 2013-10-29 10:32 -0700
                Re: Help with guessing game :D rusi <rustompmody@gmail.com> - 2013-10-29 09:24 -0700
                Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 09:31 -0700
                Re: Help with guessing game :D rusi <rustompmody@gmail.com> - 2013-10-29 09:40 -0700
                Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 10:05 -0700
                Re: Help with guessing game :D rusi <rustompmody@gmail.com> - 2013-10-29 10:13 -0700
                Re: Help with guessing game :D rurpy@yahoo.com - 2013-10-29 10:24 -0700
                Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 10:45 -0700
                Re: Help with guessing game :D rurpy@yahoo.com - 2013-10-29 11:27 -0700
                Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 11:35 -0700
                Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 12:03 -0700
                Re: Help with guessing game :D rurpy@yahoo.com - 2013-10-29 12:55 -0700
                Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 13:08 -0700
                Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 13:21 -0700
                Re: Help with guessing game :D rurpy@yahoo.com - 2013-10-29 14:25 -0700
                Re: Help with guessing game :D rusi <rustompmody@gmail.com> - 2013-10-29 10:52 -0700
                Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 10:55 -0700
                Re: Help with guessing game :D rurpy@yahoo.com - 2013-10-29 11:26 -0700
                Re: Help with guessing game :D rusi <rustompmody@gmail.com> - 2013-10-29 11:32 -0700
  Re: Help with guessing game :D Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-29 13:44 +0000
    Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 06:52 -0700
  Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 11:05 -0700
    Re: Help with guessing game :D Dave Angel <davea@davea.name> - 2013-10-29 19:09 +0000
      Re: Help with guessing game :D Robert Gonda <robertgonda1994@gmail.com> - 2013-10-29 12:15 -0700
        Re: Help with guessing game :D Dave Angel <davea@davea.name> - 2013-10-30 01:30 +0000

csiph-web