Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
27
Task/Search-a-list/Aime/search-a-list.aime
Normal file
27
Task/Search-a-list/Aime/search-a-list.aime
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
void
|
||||
search(list l, text s)
|
||||
{
|
||||
integer i;
|
||||
|
||||
i = 0;
|
||||
while (i < ~l) {
|
||||
if (l[i] == s) {
|
||||
break;
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
|
||||
o_(s, " is ", i == ~l ? "not in the haystack" : "at " + itoa(i), "\n");
|
||||
}
|
||||
|
||||
integer
|
||||
main(void)
|
||||
{
|
||||
list l;
|
||||
|
||||
l = l_effect("Zig", "Zag", "Wally", "Ronald", "Bush", "Krusty",
|
||||
"Charlie", "Bush", "Boz", "Zag");
|
||||
__ucall(search, 1, 1, l, "Bush", "Washington", "Zag");
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue