Hacker News new | ask | show | jobs
by dag11 1020 days ago
In the typescript playground, the best way to see the output of any evolution number is to have it autocomplete a string literal!

Uncomment one of the PGunXX types that you want to see, then below it type this:

    const boardstr: PGun10 = ``;

Then put the cursor inside the two backticks and press Control+Space for intellisense autocomplete, and press enter on the first entry there. Then intellisense will put the computed board into a string literal, looking like:

    const boardstr: PGun10 = `............................................
    ........................xx..................
    ........................x..x................
    ..........x.x...............x......xx.......
    ........x...x..xxx..........x......xx.......
    .xx.....x...................x...............
    .xx....x....x.......xx..x..x................
    ........x.......x.x..x..xx..................
    ........x...x.....xxx.......................
    ..........x.x...............................
    ............................................`;
1 comments

You can also use twoslash[1] caret comments in the playground to display type representations inline, even for uninitialized/declared values, so eg something like this should work:

  declare const boardstr: PGun10
  //            ^?
1: https://www.npmjs.com/package/@typescript/twoslash