https://github.com/2bt/vmtetris
Tetris in a small virtual machine (11 lines of C)
https://github.com/2bt/vmtetris
codegolf snake tetris virtual-machine
Last synced: 8 months ago
JSON representation
Tetris in a small virtual machine (11 lines of C)
- Host: GitHub
- URL: https://github.com/2bt/vmtetris
- Owner: 2bt
- Created: 2016-08-24T21:55:23.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-10-27T21:13:58.000Z (about 1 year ago)
- Last Synced: 2025-03-31T15:00:00.662Z (10 months ago)
- Topics: codegolf, snake, tetris, virtual-machine
- Language: Python
- Homepage:
- Size: 93.8 KB
- Stars: 22
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vmTetris
Tetris in a small virtual machine.
Use the cursor keys.
Press `esc` to quit.
```c
m[444],c,x;main(o,a){for(system("stty cbreak -echo min 0"),srand(a);o=f();o<42?a
=(x=o/2%7)<3?x:x<4?f():x<5?m[f()<23?x:m[x-23]]:x<6?read(0,m,1):rand()%f(),m[x=o%
2?f():m[6]++]*=o<28,a=m[x]+=o>13?a:-a:o<45?putchar(o%3?o%2*75+f():a):o<63?f(),c=
!a^o/54?x+o%9*75:c:usleep(20000));system("stty sane");}f(){return x=c++["NCRM7@\
BD;527e4R37QT?@\
LD2C^_L/VD`0N8T@?T>=guS825=2;h3252<\
h028k7RI=X66DM6R:9T6AF6A29iZX2?T?9F9?F9?RE5RE7k3T5;N558aX25C9T;5>0ji2BT5;T576:7SN456F7jlT;5213?a:-a:o<45?putchar(o%3?o%2*75+f():a):o<63?f(),c=
!a^o/54?x+o%9*75:c:usleep(20000));system("stty sane");}f(){return x=c++["RC5RQ6\
326e5R@6T5>3DP5>7eP26e=@7e2RP6D9;26eSR3=N<[JZ?[a[yfcL/V:ek6J/a56U/f3L<6Q<2/f:RQ\
<2/f@N<2/fHL<29^M251grRC5TL6^fTL7B7^fB7^f46^f@6S68>5^rF>5gP[JZ?[j[wRC5RA:RQ9TL6DQ58L6\
_O26_OB6_OZChQ[O6Q5T57TL6=8L6_l26_lB6_lZ`iCP8TL6DQ58L6`A26`AB6`A6R528hnZC`C[OT7\
5=29h8[92:h5Z7ZGZSZVZI[i[OR35TL7il25ib=TL7D_7Y25il[9nnnnn\\i/"]-47;}/**********/
```
