So there are a couple things I want to do lot done with the number Gasser quite yet in the want to play
again function let's say the user typed in a capital Y instead of lower case y.
Well I want to I want that count.
So I want to be able to say I want that to be yes.
In that case though how I really want to just ignore the chaos of character k.
So you have an ELSE case here and I'm going to say
well some is going nor anything else.
Here.
So say they pressed Y and then like a bunch of other stuff that would still work.
In this case
that's why I'm doing that.
And now I want to check to see well not check but I want to ignore the if it's a y uppercase Y or lowercase
YS How you do that is through this function call to to lower.
To lower takes a character and to learn as part of the CC type header.
So we need to include that as well.
CC type
and this will actually put any input that they set to lower case.
So now if we run it again and let's just say no it is 5.
So would you like to play again this type in the capital Y and then it works OK.
And just for checking lowercase.
Still it works and anything else of course will not.
OK so I just want to fix that quickly.
Now we need to finish the part of the game that said it should change based on
the numbers change each time.
OK.
So how we're going to do that is in fact we need another include here
include
the fact we eat to standard lib h in are going to include something called seedtime K..
And what we're going to use is a random number generator.
So how this random number generator works is we first have to seed the right number generator.
So it has to have a defaults value.
And to use unsigned int and a time function z time library call time.
This just gets the current time.
So just now basically.
OK.
And it doesn't really matter what I use here.
I could just use 0 say but random numbers aren't truly random on computers.
It kind of work based on this seed.
So depending on the seed you give it it'll give different random numbers.
So we have to see the random number generator generator first and then we can get random numbers later.
So now we want to get the random number.
So how you do that is a Rand parentheses like this and this will give you a number believe it's from
zero to Rand Max.
OK.
So but we want it to be from 0 to our upper bound.
So all we have to do is a modulus for bound like this.
OK.
In fact we do.
Now we get like so now you're in this again and we say 65 it's probably not going to be 65.
That was too high.
So let's try to get say 30 is too high will say 15.
Too low.
So we'll say when he fight.
Twenty three years.
Oh yeah.
It's 23.
And he don't want to play it.
So there are some fixes for our game.
So Rand really gives you a random number between 0 and Rand Max and the CC type which is down here to
the two lowers So basically makes any character into a lowercase character.
And so that's it for this game.
So in the next section we're going to start talking about some interesting things called pointer's.