From 49d6379c3d40b684b28f4a957ff1ffb81a2560ee Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Wed, 11 Jan 2023 16:02:26 +0530 Subject: refactor: minor refactor all around --- examples/guess-number.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/guess-number.ts') diff --git a/examples/guess-number.ts b/examples/guess-number.ts index 169805f..45d60e6 100644 --- a/examples/guess-number.ts +++ b/examples/guess-number.ts @@ -7,15 +7,15 @@ export type main = [ Bind, StartGuessing> ] +type Len = Ls['length'] extends number ? Ls['length'] : 0 + interface AskForGuess extends Kind1 { return: `${this['input']}` extends `${N}` ? PutStringLn<'Yay! You got it right!'> : Do< [ PutString<'Wrong guess. Total attempts'>, - PutStringLn<` ${[...Attempts, 0] extends infer Ls extends 0[] - ? Ls['length'] - : 0}/5`>, + PutStringLn<` ${Len<[...Attempts, 0]>}/5`>, (StartGuessing<[...Attempts, 0]> & { input: N })['return'] ] > -- cgit v1.3.1