14 lines
414 B
Text
14 lines
414 B
Text
class MAIN is
|
|
main is
|
|
haystack :ARRAY{STR} := |"Zig", "Zag", "Wally", "Ronald", "Bush", "Krusty", "Charlie", "Bush", "Bozo"|;
|
|
needles :ARRAY{STR} := | "Washington", "Bush" |;
|
|
loop needle ::= needles.elt!;
|
|
index ::= haystack.index_of(needle);
|
|
if index < 0 then
|
|
#OUT + needle + " is not in the haystack\n";
|
|
else
|
|
#OUT + index + " " + needle + "\n";
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|