Skip to content

Instantly share code, notes, and snippets.

@joseoliv
Created Aug 3, 2021
Embed
What would you like to do?
package main
object Program
func run {
Out println: ( self search: [ 3, 9, 7 ], 7 );
Out println: ( self search: [ "cd", "w", "ab" ], "w" );
var Dyn d = 0;
var Int n;
n = (d + 1)*5;
n println
}
func search: array, x -> Int {
var i = 0;
while i < array size {
if array[i] == x {
return i
}
++i
}
return -1
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment