Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How to put how many times a loop has executed in Turing?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
TheMaisha




PostPosted: Thu Dec 15, 2011 7:42 am   Post subject: How to put how many times a loop has executed in Turing?

What is it you are trying to achieve?
I want to put how many times my loop executed
Sponsor
Sponsor
Sponsor
sponsor
Raknarg




PostPosted: Thu Dec 15, 2011 2:57 pm   Post subject: RE:How to put how many times a loop has executed in Turing?

We arent going to do your homework. Have you tried anything yet?
TheMaisha




PostPosted: Thu Dec 15, 2011 10:47 pm   Post subject: Re: How to put how many times a loop has executed in Turing?

Obviously I have, or else why would a turn to a computer for help...
ProgrammingFun




PostPosted: Thu Dec 15, 2011 11:03 pm   Post subject: Re: How to put how many times a loop has executed in Turing?

TheMaisha @ Thu Dec 15, 2011 10:47 pm wrote:
Obviously I have, or else why would a turn to a computer for help...

And you obviously don't know how templates work. Do you plan on telling us what you have tried?
If not, then this is not the place to be asking this.
Zren




PostPosted: Fri Dec 16, 2011 12:33 am   Post subject: RE:How to put how many times a loop has executed in Turing?

The logic for counting is to set a variable to an initial value.
sum = 0

Then increment it.
sum = sum + 1 % sum=1
sum = sum + 1 % sum=2
sum = sum + 1 % sum=3

The short form for:
a := a + 1

Is:
a += 1

From this knowledge, you should be able to combine it with a loop fairly easily.
Scrubtastic




PostPosted: Fri Dec 16, 2011 11:26 pm   Post subject: RE:How to put how many times a loop has executed in Turing?

var a:=0
loop
a:=a+1
put a
end loop
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: