# Question:An interesting procedure

## Question:An interesting procedure

Maple

When I learning "Maple introductory programming guide", there is a little procedure attracting me:

_________________________________

NewName := proc ()

global N;

N := N+1;

while assigned(cat(C, N)) do

N := N+1;

end do;

cat(C, N);

end proc

_________________________________

This procedure is simple, and I use the following command

N:=0:C3:=1: seq(NewName(),i=1..5)

then it return "C1, C2, C4, C5, C6".

Now, let's check through the result above, N begin with 0, but the outputs are begin with C1, so I change the procedure to

_________________________________

NewName := proc ()

global N;

N := N+1;

while assigned(cat(C, N-1)) do

N := N+1;

end do;

cat(C, N-1);

end proc

_________________________________

Using the same commands,i.e. N:=0:C3:=1: seq(NewName(),i=1..5), then it return "C0, C1, C2, C4, C5", which is expected.

Now, If I can't allow to change the double N to N-1 in cat command.Instead,I want to add some syntax (if,for or while,etc.) to the first procedure,make its output begin with 0 like the second procedure. I have tried many times, but failed.

Can you tell me an answer?

Best regards.

﻿