diff options
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 ]>, |
