5 ms·
A text adventure game on TypeScript's type system
- cercatrova 4y agoRelated, discussed previously, Type-Level TypeScript: https://news.ycombinator.com/item?id=32913125 https://news.ycombinator.com/item?id=32913125
- have_faith 4y agoHow do you play the game?
- lucasmullens 4y agogit clone, make sure TypeScript is installed, and open src/index.ts Would be nice if this was exported to some TypeScript playground environment.
- yakkomajuri 4y agoEasiest is to just press `.` on the GitHub repo to open the GH dev environment
- zander312 4y agowtf! I had no idea this existed!
- auggierose 4y agoToo bad there is no such thing as HN comment of the week, this would be it.
- TillE 4y agoI'm really surprised I've never even discovered that accidentally. If nothing else, this is a vastly superior way to search a repository.
- culi 4y agoIt was added about a year ago so it's fairly recent. Before this another group had made this same thing on a different website (turns out a big advantage of Electron apps is they can be converted to web apps without TOO much difficulty). With that one you'd just replace the domain of the URL with whatever that website was
- trevor-e 4y agowait... WHAT!? how is such an amazing feature hidden behind some incredibly obscure keyboard shortcut? this completely changes how I'll explore Github.
- deleted 4y ago[deleted]
- ppradhan 4y agowhat am I doing wrong. 'press . on the Github repo' ?
- unsafecast 4y agoJust open the repository and type a dot on your keyboard. You don't need to select anything.
- n1c 4y agoWith the page open in your browser, press the "." key on your keyboard.
- bilalq 4y agoI never get tired of seeing fun little things like this. Is there a way to make VSCode not truncate the type info?
- JeanMeche 4y agoIt's an open ticket. https://github.com/microsoft/vscode/issues/94679 https://github.com/microsoft/vscode/issues/94679
- wwwigham 4y ago`noErrorTruncation: true` in a tsconfig.[1] It also affects hover and quickinfo truncation. Technically it will still truncate, just at a way higher limit, like a million characters. [1]https://www.typescriptlang.org/tsconfig#noErrorTruncation https://www.typescriptlang.org/tsconfig#noErrorTruncation
- cercatrova 4y ago> Setting "noErrorTruncation": true, as proposed in the previous answer, does not work for this question as asked. https://stackoverflow.com/questions/62508909/vs-code-how-to-show-full-typescript-definition-on-mouse-hover/69223288#69223288 https://stackoverflow.com/questions/62508909/vs-code-how-to-...
- dschuessler 4y agoWhat a beautiful little treat. For everyone curious, it took me less than ten minutes to play through. Well done!
- notjustanymike 4y agoWeirdly, a spider killing me isn't the worst thing I've seen written in Typescript.
- cacozen 4y agoLol
- foota 4y agoWhat the fuck
- JohnDotAwesome 4y agoFor those wanting a TS Playground link: https://tinyurl.com/mw6pbpht https://tinyurl.com/mw6pbpht
- frabjoused 4y agoI made a PR to add this link to the readme.
- mckravchyk 4y agoIf you have been wondering how much data a uri hash can store. Firefox can handle up to 1M characters, Chromium much more. I did not test Safari and mobile browsers though. This game is at 12k encoded and is far from hitting the limit. https://stackoverflow.com/questions/16247162/max-size-of-location-hash-in-browser https://stackoverflow.com/questions/16247162/max-size-of-loc...
- noduerme 4y agoThis 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 4y agoIt’s just so I can later reuse that type without having to pass in the generic. Like I do on lines 41 and 42
- koshergweilo 4y agoAn 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
- wildgeodude 4y agoThis is really neat, thanks!
- durnygbur 4y agoSo 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.