-
-
Save kublaj/0ec81fb7309a61e6ca2f3b8a1739f392 to your computer and use it in GitHub Desktop.
Todo-list generator for webdev.dartlang.org/guides/get-started
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
void main() { | |
thingsTodo().forEach(print); | |
} | |
Iterable<String> thingsTodo() sync* { | |
var actions = ['Walk', 'Wash', 'Feed']; | |
var pets = ['cats', 'dogs']; | |
for (var action in actions) { | |
for (var pet in pets) { | |
if (pet == 'cats' && action != 'Feed') continue; | |
yield '$action the $pet'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment