1) Generate random prefix in this case. cc2h_, for instance. It's unique and easy to replace with anything else any time.
2) Ok, if you like co 2.
"for i from 0 to 6 by 1" works in the following way
i = 0
while (i <= 6) do ...your code ... i = i + 1
end;
So i will become 7 and the loop will end. 7 > 6.
Here is classical linear search algorithm:
Code:
Initialize counters
while (check if we still in physical bounds of array) and (check if current item does not match our demands)
Increase counter (go to the next counter)
end;
To check, if search succeeded, use the same physical bounds condition. If we still in array bounds, then something was found.