Skip to content

Instantly share code, notes, and snippets.

@antonioreyna
Created August 16, 2016 05:29
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 antonioreyna/573c98f044c4a466a9d2a400d627e47e to your computer and use it in GitHub Desktop.
Save antonioreyna/573c98f044c4a466a9d2a400d627e47e to your computer and use it in GitHub Desktop.
sum = 0
let sizes:[CGFloat] = [
50.0,
21.0,
50.0,
29.0,
50.0,
21.0,
50.0,
]
let toIndex:Int = 3
for (i=0; i<sizes; i++) {
if (i<=toIndex) {
sum += sizes[i]
}
}
return sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment