Last active
May 31, 2017 04:40
-
-
Save heath/8923724 to your computer and use it in GitHub Desktop.
This file contains 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
# adds a banana to grocery list a given number of times | |
add_banana_to_grocery_list = (times) -> for til times | |
banana = element.all($ "button.button-continue").first! | |
..click! |
This file contains 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
-- first implementation | |
add_banana_to_grocery_list times = replicateM_ times $ click banana | |
-- second implementation | |
add_banana_to_grocery_list = (`replicateM_` click banana) | |
-- third | |
add_banana_to_grocery_list = (flip replicateM_) $ click |
This file contains 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
// adds a banana to a grocery list a given number of times | |
var add_banana_to_grocery_list = function(times) { | |
for (var count = 0; count < times; count++) { | |
var banana = element.all($("button.button-continue")).first(); | |
banana.click(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment