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


Groups > comp.lang.python > #43298

Re: guessthenumber print games left

References <0e8b4a09-3d1d-4b92-a0ef-2274a2a651c9@googlegroups.com> <mailman.403.1365587062.3114.python-list@python.org> <a183cc9a-9a8b-4bf1-9710-e1e5aafaafe8@googlegroups.com>
Date 2013-04-11 08:31 +1000
Subject Re: guessthenumber print games left
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.427.1365633088.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Apr 11, 2013 at 7:01 AM,  <eschneider92@comcast.net> wrote:
> On Wednesday, April 10, 2013 5:44:20 AM UTC-4, Chris Angelico wrote:
>> On Wed, Apr 10, 2013 at 7:39 PM,  <eschneider92@comcast.net> wrote:
>>
>> You have here a counter, but it's counting up. To figure out how many
>> games are left, just subtract the numberofgames from the total number
>> of games that you'll be allowing - that's how many there are left. Do
>> you know how to do that?
>>
>
> Thanks for the quick reply. I've been trying your advice but I can't figure it out. If anyone could show me how to do it in program form, it would be much obliged.

Set your current code aside, and just make a program that counts games
without actually playing them. Start with this part of your existing
code:

numberofgames=1
while numberofgames<4:
    numberofgames=numberofgames+2

That will run, but do nothing. Now add a print call to the loop, and
see if you can work out how to make it count how many games are left.

If you get stuck, post the code for just this program and we'll see
where it takes us!

ChrisA

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


Thread

guessthenumber print games left eschneider92@comcast.net - 2013-04-10 02:39 -0700
  Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-10 19:44 +1000
    Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 14:01 -0700
      Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 08:31 +1000
    Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 14:01 -0700
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 22:34 -0700
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 22:41 -0700
    Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 15:48 +1000
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 22:56 -0700
    Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 16:02 +1000
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 23:15 -0700
    Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 16:27 +1000
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-11 00:15 -0700
    Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 17:27 +1000
    Re: guessthenumber print games left Neil Cerutti <neilc@norwich.edu> - 2013-04-11 12:31 +0000

csiph-web