Skip to content

Instantly share code, notes, and snippets.

@ruda
Created September 24, 2018 00:03
Show Gist options
  • Save ruda/34a560672d2c1e968d98220d0886286b to your computer and use it in GitHub Desktop.
Save ruda/34a560672d2c1e968d98220d0886286b to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#include <sys/ioctl.h>
int
main(int argc, char *argv[])
{
struct winsize ws;
ioctl(STDIN_FILENO, TIOCGWINSZ, &ws);
int size = (ws.ws_col) * (ws.ws_row-1);
for(int i; i < size; i++)
putchar(rand() % 2 ? '/':'\\');
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment