top | item 32930605

A text adventure game on TypeScript's type system

293 points| cacozen | 3 years ago |github.com | reply

31 comments

order
[+] bilalq|3 years ago|reply
I never get tired of seeing fun little things like this. Is there a way to make VSCode not truncate the type info?
[+] JohnDotAwesome|3 years ago|reply
For those wanting a TS Playground link: https://tinyurl.com/mw6pbpht
[+] frabjoused|3 years ago|reply
I made a PR to add this link to the readme.
[+] durnygbur|3 years ago|reply
So which one should now one study - TypeScript type system, RxJS operators, or the next generation of vomit produced by the Angular team? Together they compose extremely unfunny clusterfuck. For now my CVs all fall into a black hole, you better not fall off the employment train.
[+] koshergweilo|3 years ago|reply
An interesting tidbit that I found in the source code is that it only accepts integers from 1 to 20. Perfectly sufficient for its use case, although not quite extendable as I would hope
[+] noduerme|3 years ago|reply
This is neat. Can someone explain why the generic types extending string need to default to any in all these cases, like: `TDescription extends string = any` ?
[+] cacozen|3 years ago|reply
It’s just so I can later reuse that type without having to pass in the generic. Like I do on lines 41 and 42
[+] dschuessler|3 years ago|reply
What a beautiful little treat. For everyone curious, it took me less than ten minutes to play through. Well done!
[+] have_faith|3 years ago|reply
How do you play the game?
[+] lucasmullens|3 years ago|reply
git clone, make sure TypeScript is installed, and open src/index.ts

Would be nice if this was exported to some TypeScript playground environment.

[+] notjustanymike|3 years ago|reply
Weirdly, a spider killing me isn't the worst thing I've seen written in Typescript.