Created
September 1, 2016 19:16
-
-
Save tangentstorm/6af999d132bfe56b3c63f7adb7f0e83d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define I(n) for(int i=0; i<n; i++) | |
#define J(n) for(int j=0; j<n; j++) | |
#define O(str) printf(str) | |
#define Oc(c) putc(c, stdout) | |
#define M(x,y,c) m[y][x]=c; | |
int main() { | |
char c; char m[22][10]; | |
J(22) I(10) m[j][i] = '.'; | |
do switch(c = getc(stdin)) { | |
case 'p': | |
case 'P': J(22){ I(10){ Oc(m[j][i]); Oc(' '); } Oc('\n'); } break; | |
case 'T': M(5,0,'m'); M(6,0,'m'); M(7,0,'m'); M(6,1,'m'); break; | |
default: break; | |
} while (c != 'q'); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment