Skip to content

Instantly share code, notes, and snippets.

@krokrob
Created January 7, 2016 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krokrob/303328cb9afbff8375c3 to your computer and use it in GitHub Desktop.
Save krokrob/303328cb9afbff8375c3 to your computer and use it in GitHub Desktop.
#
def highlow(array)
min = array[0]
max = array[0]
for number in array
if number < min
min = number
end
if number > max
max = number
end
end
resultat = [min, max]
end
p highlow([24, 34, 56, 135, 3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment