mevdschee / 2048.c

Console version of the game "2048" for GNU/Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

about ascii

youngjeff opened this issue · comments

I can't understand the ascii about left arrow, right arrow, up arrow and down arrow .
I just know letter D is 68,what about left arrow?

@youngjeff left arrow is in fact an extended character, mapping to "^[[D" or "27, 91, 68"

    <?php
    exec("stty -icanon"); // turn off input buffering
    while (true) echo " ".ord(fgetc(STDIN)).",";

You can try the above PHP script on the command line and see it for yourself.