#include #include #include #include #include "jsf.h" static const char noise[] = "..,`':;~+=< _ij\"^\\l(amxvu04PYW"; inline static char rndchar(void) { size_t index = 0; size_t len = sizeof(noise) / sizeof(char); while (1) { size_t x = jsf_below(8); index += x; if (x < 5) break; } if (index >= len) index = 0; return noise[index]; } int main(void) { jsf_init(arc4random()); setlocale(LC_ALL, ""); initscr(); cbreak(); curs_set(FALSE); leaveok(stdscr, TRUE); noecho(); int percent = LINES * COLS / 5; for (int i = 0; i < percent; ++i) { int yy = (int) jsf_below((unsigned) LINES); int xx = (int) jsf_below((unsigned) COLS); mvaddch(yy, xx, rndchar()); } getch(); endwin(); }