To count # of games/Limit the # of games 
Author Message
 To count # of games/Limit the # of games

Hi,

I'm a student at DeVry... in C programming at this time.  I have a
project where I'm trying to accomplish among other things, two in
particular.  It is the random number game set for random numbers between
1 and 100 and the person guesses up to so many tries.  There are scanf
and printf functions used to accomplish this with a for loop and a do
while loop.  The two things I'm trying to do which I'm having problems
with are:

1) To count the number of games played by user.
2) To Limit the number of games played by user to 5.

I can get it to do either but not both.  Any suggestions from this brief
description of the problem?

--
=================================================

Ken's Family Cottage Homepage
http://www.*-*-*.com/ ~kn/



Thu, 08 Feb 2001 03:00:00 GMT  
 To count # of games/Limit the # of games

Quote:

> The two things I'm trying to do which I'm having problems
> with are:

Hi Ken Branham,

Quote:
> 1) To count the number of games played by user.

Declare:                 int gameCounter = 0;
Later in the code do:    gameCounter += 1;

Quote:
> 2) To Limit the number of games played by user to 5.

 if ( gameCounter > 5 )
 {
    printf( "Sorry, that's it. You're out.\n" );
    exit( 0 );
 }

Quote:
> I can get it to do either but not both.

Huh ? What is your precise problem ?

Quote:
> Any suggestions from this brief description of the problem?

See above. It appears to be a very simple task. If my solution
does not match your problem, please try to be more specific.
Maybe post a small (hopefully complete) sample program that
demonstrates your problem.

Stephan
(initiator of the campaign against grumpiness in c.l.c)



Fri, 09 Feb 2001 03:00:00 GMT  
 To count # of games/Limit the # of games
Groovy hepcat Ken Branham was jivin' on Sun, 23 Aug 1998 19:28:12
-0400 in comp.lang.c.
To count # of games/Limit the # of games's a cool scene! Dig it!

Quote:
>particular.  It is the random number game set for random numbers between
>1 and 100 and the person guesses up to so many tries.  There are scanf
>and printf functions used to accomplish this with a for loop and a do
>while loop.  The two things I'm trying to do which I'm having problems
>with are:

>1) To count the number of games played by user.
>2) To Limit the number of games played by user to 5.

>I can get it to do either but not both.  Any suggestions from this brief
>description of the problem?

  Yes. Post some code. We can hardly be expected to know what's wrong
with your program if we can't see any of it.
  So, please post the smallest possible *compilable* piece of code
that demonstrates the problem.
--

----- Dig the EVEN NEWER, MORE IMPROVED news sig!! -----

-------------- Shaggy was here! ---------------
    http://aardvark.apana.org.au/~phaywood/
============= Ain't I'm a dawg!! ==============



Mon, 12 Feb 2001 03:00:00 GMT  
 To count # of games/Limit the # of games
Peter,

I took your advice and got good assistance.  Thanks.

Ken

Quote:

> Groovy hepcat Ken Branham was jivin' on Sun, 23 Aug 1998 19:28:12
> -0400 in comp.lang.c.
> To count # of games/Limit the # of games's a cool scene! Dig it!

> >particular.  It is the random number game set for random numbers between
> >1 and 100 and the person guesses up to so many tries.  There are scanf
> >and printf functions used to accomplish this with a for loop and a do
> >while loop.  The two things I'm trying to do which I'm having problems
> >with are:

> >1) To count the number of games played by user.
> >2) To Limit the number of games played by user to 5.

> >I can get it to do either but not both.  Any suggestions from this brief
> >description of the problem?

>   Yes. Post some code. We can hardly be expected to know what's wrong
> with your program if we can't see any of it.
>   So, please post the smallest possible *compilable* piece of code
> that demonstrates the problem.
> --

> ----- Dig the EVEN NEWER, MORE IMPROVED news sig!! -----

> -------------- Shaggy was here! ---------------
>     http://aardvark.apana.org.au/~phaywood/
> ============= Ain't I'm a dawg!! ==============

--
=================================================

Ken's Family Cottage Homepage
http://www.asacomp.com/~kn/



Mon, 12 Feb 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Video Game Programmers wanted by Gizmo Games

2. first dx9 managed game homepage

3. C# for game development?

4. New game... (was Why Mustinherit)

5. game programming

6. game / indirect recursion (4-way-movement)

7. Newsgroup for non-game graphics design??

8. games in C#

9. Translation of Java games

10. volvi.net Gaming Collaboration

11. Interpreted C/C++ for game scripting

12. games programmer wanted for open source MMORPG project

 

 
Powered by phpBB® Forum Software