
-----------------------------------
TheMaisha
Thu Dec 15, 2011 7:42 am

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

-----------------------------------
Raknarg
Thu Dec 15, 2011 2:57 pm

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
Thu Dec 15, 2011 10:47 pm

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
Thu Dec 15, 2011 11:03 pm

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...
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
Fri Dec 16, 2011 12:33 am

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
Fri Dec 16, 2011 11:26 pm

RE:How to put how many times a loop has executed in Turing?
-----------------------------------
var a:=0
loop
a:=a+1
put a
end loop
