10 lines
278 B
Text
10 lines
278 B
Text
var haystack = %w(Zig Zag Wally Ronald Bush Krusty Charlie Bush Bozo);
|
|
|
|
%w(Bush Washington).each { |needle|
|
|
var i = haystack.first_index{|item| item == needle};
|
|
if (i >= 0) {
|
|
say "#{i} #{needle}";
|
|
} else {
|
|
die "#{needle} is not in haystack";
|
|
}
|
|
}
|