이런거 처음만들어봄

덕분에 대충 그래픽API로 눈내리게하는거 방법은 알것같아요


근데 쓸데가 없네요...





#include <Windows.h> #include <time.h> static HANDLE h; static DWORD cCharsWritten; clsxy(x, y) { COORD coordScreen = { x, y }; FillConsoleOutputCharacter(h, (TCHAR) ' ', 1, coordScreen, &cCharsWritten); } putxy(x, y, w) { COORD coordScreen = { x, y }; FillConsoleOutputCharacter(h, (TCHAR) w, 1, coordScreen, &cCharsWritten); }

typedef struct { int x, y, z; } $; static $ store[150]; static int pointE, max; init() { srand(time(NULL)); h = GetStdHandle(STD_OUTPUT_HANDLE); pointE = 0; } next() { return rand(); } nextsi() { return (rand() % 6) - 3; } nextss() { return (rand() % 8) - 4; } inits(s) $* s;{ s->x = next() % 80; s->y = 0; s->z = ".'`*"[next() % 4];} create$() { if (pointE < 150) { inits(&store[pointE++]); if (max != 150) max = pointE; } else { max = 150; pointE = 0; } } create5() { for ( int i = 0; i < 5; i++ ) create$(); } $ copy$(s) $ s; { $ r = { s.x, s.y, s.z }; return r; } draw$(p, n) $ p; $ n; { clsxy(p.x, p.y); putxy(n.x, n.y, n.z); } grow$(s) $*s; { s->x += nextsi(); s->y += 1; } chk$(s) $ s; { if (s.y + nextss() < 20) return 1; return 0; } main() { init(); create5(); while(1) { for ( int i = 0; i < max; i++) { if (chk$(store[i])) { $ t = copy$(store[i]); grow$(&store[i]); draw$(t, store[i]); } } Sleep(200); create5(); } return 0; }