diff options
| author | Akshay Nair <phenax5@gmail.com> | 2023-01-08 22:53:09 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2023-01-08 22:53:09 +0530 |
| commit | a41d70afe7692e4ef344bc3c599115009f2dad15 (patch) | |
| tree | 64fb57effa636a60751ea27178cf9a63b3b434ab /examples/guess-number.ts | |
| parent | c79c5bf7a44c59cd1e484a538e2dddf264012f57 (diff) | |
| download | ts-types-lang-a41d70afe7692e4ef344bc3c599115009f2dad15.tar.gz ts-types-lang-a41d70afe7692e4ef344bc3c599115009f2dad15.zip | |
refactor: splits runtime up to use context
Diffstat (limited to '')
| -rw-r--r-- | examples/guess-number.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/guess-number.ts b/examples/guess-number.ts index 92674fd..a20c993 100644 --- a/examples/guess-number.ts +++ b/examples/guess-number.ts @@ -1,7 +1,7 @@ import { Print, PutString, Bind, Kind1, JsExpr, ReadLine, Do, PutStringLn } from '../stdlib' export type main = [ - PutStringLn<"You have 5 guesses">, + PutStringLn<"Guess a number between 0 & 9. You have 5 guesses">, Bind< JsExpr<"Math.floor(Math.random() * 10)">, StartGuessing @@ -14,7 +14,7 @@ interface AskForGuess<N extends number, Attempts extends 0[]> extends Kind1<stri : Do<[ Print<`Wrong guess. Total attempts: ${ [...Attempts, 0] extends infer Ls extends 0[] ? Ls['length'] : 0 - }`>, + }/5`>, (StartGuessing<[...Attempts, 0]> & { input: N })['return'], ]> } |
