Jump to content

Search a list: Difference between revisions

no edit summary
mNo edit summary
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}}==
1,532

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.