Search a list: Difference between revisions
no edit summary
mNo edit summary |
Drkameleon (talk | contribs) No edit summary |
||
Line 231:
5 Bush
</pre>
=={{header|Arturo}}==
<lang arturo>haystack: #("Zig" "Zag" "Wally" "Ronald" "Bush" "Krusty" "Charlie" "Bush" "Bozo")
loop #("Bush" "Washington") @(needle){
f: index haystack needle
if f>=0 { print f + " => " + needle } { panic "'" + needle + "' not in haystack" }
}
</lang>
{{out}}
<pre>4 => Bush
✘ Runtime Error @ file: examples/rosetta/SearchAList.art - line: 4
| program panic
| msg: 'Washington' not in haystack</pre>
=={{header|AutoHotkey}}==
|