Skip to content

Instantly share code, notes, and snippets.

@kgersen
Created March 12, 2015 23:21
Show Gist options
  • Save kgersen/4a65a1f1b1fcdf7b39e9 to your computer and use it in GitHub Desktop.
Save kgersen/4a65a1f1b1fcdf7b39e9 to your computer and use it in GitHub Desktop.
<canvas id="myCanvas" width="500" height="500"></canvas>
void main() {
List<int> tableau = [1, 10, -5, 3, 4, -8, 2];
int idx = tableau.takeWhile((i)=>i>0).length;
if (idx==tableau.length) idx = -1;
print("index = $idx");
}
p {
color: #888;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment