Computer Science Canada Need Help with Turing |
Author: | SAValkyrie [ Thu Nov 01, 2012 7:48 pm ] |
Post subject: | Need Help with Turing |
What is it you are trying to achieve? Trying to write a program that endlessly tells you to "Have a good day" Tr y stopping execution. Change it so that it is a program to wish you a good day only six times. What is the problem you are having? I got the "Have a good day" part but I cannot figure you the only six times part. With my knowledge, the only thing i can do is to state the word that can stop the execution. Is there a way to stop it when it counts 6 times? Please specify what version of Turing you are using Turing 4.1.2 |
Author: | chipanpriest [ Thu Nov 01, 2012 7:58 pm ] | ||
Post subject: | Re: Need Help with Turing | ||
Either look into increments. or if you're really adventurous, look into for statements. I'll give you this much, to exit a loop, you can type "exit when". Eg.
You can set the whatever to anything you want, which can help in your situation. Think about it, if you want the loop to exit after 6 times, how would you get the loop to count? |
Author: | SAValkyrie [ Thu Nov 01, 2012 8:22 pm ] | ||
Post subject: | Re: Need Help with Turing | ||
Is the use of count appropriate in this situation?[/syntax] |
Author: | Tony [ Thu Nov 01, 2012 8:33 pm ] |
Post subject: | RE:Need Help with Turing |
Yes, you can use for-loops to execute a piece of code a specific number of times. |
Author: | SAValkyrie [ Thu Nov 01, 2012 8:36 pm ] | ||
Post subject: | Re: Need Help with Turing | ||
ah i got it[/syntax][/quote] |
Author: | chipanpriest [ Fri Nov 02, 2012 5:25 am ] | ||
Post subject: | Re: Need Help with Turing | ||
LOL your second comment was different than your first. Both work though. You could use a for statement:
I like this better but both ways work. |