more dumb geometry block tricks

This commit is contained in:
nick black 2020-01-25 22:35:26 -05:00
parent c3d4ac8caa
commit 652cfbc9f1
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -28,12 +28,10 @@ int main(void){
struct timespec delay = { .tv_sec = 0, .tv_nsec = 250000000, }; struct timespec delay = { .tv_sec = 0, .tv_nsec = 250000000, };
while(true){ while(true){
for(int i = xl ; i <= xr ; ++i){ for(int i = xl ; i <= xr ; ++i){
wchar_t w;
if(ncplane_putwc_yx(n, 0, i, i % 2 == flipmode % 2 ? L'' : L'') <= 0){ if(ncplane_putwc_yx(n, 0, i, i % 2 == flipmode % 2 ? L'' : L'') <= 0){
goto err; goto err;
} }
}
for(int i = xl ; i <= xr ; ++i){
wchar_t w;
switch(flipmode % 6){ switch(flipmode % 6){
case 0: w = L'🞯'; break; case 0: w = L'🞯'; break;
case 1: w = L'🞰'; break; case 1: w = L'🞰'; break;
@ -46,9 +44,6 @@ int main(void){
if(ncplane_putwc_yx(n, 1, i, w) <= 0){ if(ncplane_putwc_yx(n, 1, i, w) <= 0){
goto err; goto err;
} }
}
for(int i = xl ; i <= xr ; ++i){
wchar_t w;
switch((i + flipmode) % 5){ switch((i + flipmode) % 5){
case 0: w = L'🞅'; break; case 0: w = L'🞅'; break;
case 1: w = L'🞆'; break; case 1: w = L'🞆'; break;
@ -60,9 +55,6 @@ int main(void){
if(ncplane_putwc_yx(n, 2, i, w) <= 0){ if(ncplane_putwc_yx(n, 2, i, w) <= 0){
goto err; goto err;
} }
}
for(int i = xl ; i <= xr ; ++i){
wchar_t w;
switch((flipmode + 5) % 6){ switch((flipmode + 5) % 6){
case 0: w = L'🞵'; break; case 0: w = L'🞵'; break;
case 1: w = L'🞶'; break; case 1: w = L'🞶'; break;
@ -75,9 +67,6 @@ int main(void){
if(ncplane_putwc_yx(n, 3, i, w) <= 0){ if(ncplane_putwc_yx(n, 3, i, w) <= 0){
goto err; goto err;
} }
}
for(int i = xl ; i <= xr ; ++i){
wchar_t w;
switch(flipmode % 11){ switch(flipmode % 11){
case 0: w = L'🞌'; break; case 0: w = L'🞌'; break;
case 1: w = L'🞍'; break; case 1: w = L'🞍'; break;
@ -95,9 +84,6 @@ int main(void){
if(ncplane_putwc_yx(n, 4, i, w) <= 0){ if(ncplane_putwc_yx(n, 4, i, w) <= 0){
goto err; goto err;
} }
}
for(int i = xl ; i <= xr ; ++i){
wchar_t w;
if(i % 2){ if(i % 2){
switch(flipmode % 4){ switch(flipmode % 4){
case 0: w = L''; break; case 0: w = L''; break;
@ -118,6 +104,19 @@ int main(void){
if(ncplane_putwc_yx(n, 5, i, w) <= 0){ if(ncplane_putwc_yx(n, 5, i, w) <= 0){
goto err; goto err;
} }
if(ncplane_putwc_yx(n, 6, i, i % 2 == flipmode % 2 ? L'' : L'') <= 0){
goto err;
}
switch(flipmode % 4){
case 0: w = L''; break;
case 1: w = L''; break;
case 2: w = L''; break;
case 3: w = L''; break;
default: goto err;
}
if(ncplane_putwc_yx(n, 7, i, w) <= 0){
goto err;
}
} }
if(notcurses_render(nc)){ if(notcurses_render(nc)){
notcurses_stop(nc); notcurses_stop(nc);