-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (29 loc) · 1.05 KB
/
main.cpp
File metadata and controls
34 lines (29 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <stdio.h> //msvc infers
#include <cstring> //msvc infers
#include <cstdlib> //msvc infers
#include <chrono> //not included in character count
#include <thread> //not included in character count
using namespace std;using I=int;
I d=1,s=0,A=9,F=400;char o[400],
u,a;struct C{C*h=0;I l=8;};I ///
main(){thread T([]{for(;a=//////
getchar(
);)u=a//
<97?u:a;
});for(C
*b=new C,*f=b;memset(o,46,F);){I i=0;for(C*c=b;c
;o[c->l]=79,c=c->h)if(o[c->l]==79|f->l>=F|f->l<0
)exit(s);for(o[A]=120;i<F+20;++i)printf(i<F&&i//
%20?"%c":"\n%c",(i<F)*o[i]);this_thread::///////
sleep_for
(200ms);
d=(u&2//
?20:1)*(
(u&2^u/2&2)-1);f
=f->h=new C(*f);
if((f->l+=d)==A)
++s,A=rand()%F//
;else{C*p=b;b=/* */b->h//
;delete p;}}}/*/ Thanks 4
playn snake! 457 charsC++
(c)MilesCaprio 2023V2.0 */