diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-01-06 23:33:00 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-01-06 23:35:33 +0530 |
| commit | d5d685253568f8c6855dd873ac3623e0af642d54 (patch) | |
| tree | 3274f8eb52e64e60ab86080f20a55339f4ca5e35 /examples/guess-number.ts | |
| parent | 4d82623f191042c362ddd2ad5e8ded99d5854169 (diff) | |
| download | ts-types-lang-d5d685253568f8c6855dd873ac3623e0af642d54.tar.gz ts-types-lang-d5d685253568f8c6855dd873ac3623e0af642d54.zip | |
feat: adds output for custom effects + adds custom effect example for ffi
Diffstat (limited to 'examples/guess-number.ts')
| -rw-r--r-- | examples/guess-number.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/guess-number.ts b/examples/guess-number.ts index 8f5d535..79f6ad1 100644 --- a/examples/guess-number.ts +++ b/examples/guess-number.ts @@ -1,4 +1,4 @@ -import { Print, PutString, Bind, Kind1, JsExpr, ReadLine, Then, PutStringLn } from '../src/stdlib' +import { Print, PutString, Bind, Kind1, JsExpr, ReadLine, Do, PutStringLn } from '../src/stdlib' export type main = [ PutStringLn<"You have 5 guesses">, @@ -11,7 +11,7 @@ export type main = [ interface AskForGuess<N extends number, Attempts extends 0[]> extends Kind1<string> { return: `${this['input']}` extends `${N}` ? PutStringLn<"Yay! You got it right!"> - : Then<[ + : Do<[ Print<`Wrong guess. Total attempts: ${ [...Attempts, 0] extends infer Ls extends 0[] ? Ls['length'] : 0 }`>, @@ -23,7 +23,7 @@ interface StartGuessing<Attempts extends 0[] = []> extends Kind1<number> { return: Attempts['length'] extends 5 ? PutStringLn<"Max attempts exceeded. Game over!"> : Bind< - Then<[ + Do<[ PutString<"Your guess? ">, ReadLine ]>, |
