Question: Boolean algebra in combination with "for i from 1 to 9"

Hi there!

I am trying to tell Maple to print something one time once a condition has been met for a variable that ranges from a to b, let's say from 1 to 9 in this case. Testbestanden is to be printed, if (F[i]+F[i+1]<20) is true for every i, and Durchgefallen is to be printed as soon as one counterexample is found. The following code illustrates what I need, it doesn't work, however. What is the correct syntax? Switching the lines "if (F[i]+F[i+1]<20)" and "for i from 1 to 9" leads to Maple printing "Testbestanden" for every i that fulfils the statement which is not what I need either.

for i from 1 to 10 do
  F[i]:=i
end do;

if (F[i]+F[i+1]<20)
for i from 1 to 9
then print(Testbestanden)

else print(Durchgefallen)
end if
end do

Thank you in advance! :)

Please Wait...