Posted: Mon Oct 15, 2012 9:23 pm Post subject: RE:Problem with Restarting Loop, and Counter
instead of myCounter = myCounter + 1;
use myCounter += 1;
it does the same thing, its more shorter and efficient in the same manner.
Sponsor Sponsor
tristanbryce7
Posted: Tue Oct 16, 2012 4:28 pm Post subject: Re: Problem with Restarting Loop, and Counter
To be honest, I dont know what increment means lol.
I dont know where else to put the
myCounter += 1 statement to make it much more efficient. I'll ponder over it thought
tristanbryce7
Posted: Tue Oct 16, 2012 4:34 pm Post subject: Re: Problem with Restarting Loop, and Counter
and taking Claytons and QuantamPhysics advice
i changed it to
Turing:
endloop
%The various statements that the program tells the user what their guess was in relation to the number
myCounter +=1 if guessInt > random then put"The Number you entered is too high!"
elsif guessInt < random then put"The Number you entered is too low!"
elsif guessInt = random then put"You got it!"
put"It took you ", myCounter, " try/tries to find the number!"%Once they guess the correct number, this statement tells them how many tries it took them delay(2100)%Stops the program for 2.1 seconds before restarting the loop cls exit endif
and it worked either way
Insectoid
Posted: Tue Oct 16, 2012 5:26 pm Post subject: RE:Problem with Restarting Loop, and Counter
Learn to use Google. Or a dictionary. Solving your own problems is the first and most important step in learning to program.
tristanbryce7
Posted: Tue Oct 16, 2012 5:38 pm Post subject: Re: Problem with Restarting Loop, and Counter
Definitely, I just needed some help getting started .