Created
May 22, 2015 11:54
-
-
Save alketii/7ebb497c088c52ab3773 to your computer and use it in GitHub Desktop.
Find the smallest number in an array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func minNumber(numbers): | |
var currentMin = numbers[0] | |
for number in numbers: | |
if currentMin > number: | |
currentMin = number | |
return currentMin | |
func _ready(): | |
print(minNumber([5,2,3,4])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment