-
-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update all examples to basic-cli version and mark broken examples
- Loading branch information
1 parent
f727aea
commit ffda01e
Showing
9 changed files
with
55 additions
and
48 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
app "countdown" | ||
packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.6.0/QOQW08n38nHHrVVkJNiPIjzjvbR3iMjXeFY5w1aT46w.tar.br" } | ||
imports [pf.Stdin, pf.Stdout, pf.Task.{ await, loop, succeed }] | ||
imports [pf.Stdin, pf.Stdout, pf.Task.{ await, loop }] | ||
provides [main] to pf | ||
|
||
main = | ||
_ <- await (Stdout.line "\nLet's count down from 10 together - all you have to do is press <ENTER>.") | ||
_ <- await (Stdout.line "\nLet's count down from 3 together - all you have to do is press <ENTER>.") | ||
_ <- await Stdin.line | ||
loop 10 tick | ||
loop 3 tick | ||
|
||
tick = \n -> | ||
if n == 0 then | ||
_ <- await (Stdout.line "🎉 SURPRISE! Happy Birthday! 🎂") | ||
succeed (Done {}) | ||
Task.ok (Done {}) | ||
else | ||
_ <- await (n |> Num.toStr |> \s -> "\(s)..." |> Stdout.line) | ||
_ <- await Stdin.line | ||
succeed (Step (n - 1)) | ||
Task.ok (Step (n - 1)) |
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
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
Binary file not shown.
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
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
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