summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoran S. Diao <0@hairydiode.xyz>2019-04-02 09:17:41 -0400
committerHaoran S. Diao <0@hairydiode.xyz>2019-04-02 09:17:41 -0400
commit631124538c3b17aaaf3e3179316a3dd0568815b7 (patch)
tree16a0396d090b1f957ffaeaa6997bcf4eb9823911
parent4017e5d2e10762405b90e6faf3dcdf3ec71b0afa (diff)
removed tabs and replaced them with spaces
-rw-r--r--card.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/card.c b/card.c
index b9b8ede..41032b0 100644
--- a/card.c
+++ b/card.c
@@ -1,23 +1,23 @@
#include <stdio.h>
#define LOOP(cl,ln)\
for(int j=0;j<40; \
- j++){for(int i=0;i<\
- 80;i++){cl}ln }
- char grid[80][40]={{
- 0,0,2},{2,0,2},{0,2,
- 2},0};int neighbor
- (int x,int y){int ct
- =0;for(int j=-1;j<=1
+ j++){for(int i=0;i<\
+ 80;i++){cl}ln }
+ char grid[80][40]={{
+ 0,0,2},{2,0,2},{0,2,
+ 2},0};int neighbor
+ (int x,int y){int ct
+ =0;for(int j=-1;j<=1
;j++){for(int i=-1;i
- <=1;i++){if(!((i==0)
- &&(j==0))){if(grid[(
- x+i+80)%80][(y+j+40)
- %40]&0x02){ct++;}}}}
- switch (ct){case 2 :
- if(grid[x][y]&0x02){
- return 1;}else {
- return 0;}case 3 :
- return 1 ;
+ <=1;i++){if(!((i==0)
+ &&(j==0))){if(grid[(
+ x+i+80)%80][(y+j+40)
+ %40]&0x02){ct++;}}}}
+ switch (ct){case 2 :
+ if(grid[x][y]&0x02){
+ return 1;}else {
+ return 0;}case 3 :
+ return 1 ;
default:return 0;}}int main(int argc,char*argv[]){int r=0;do
{r = fgetc(stdin);LOOP(if(grid[i][j]&0x02){printf("X");}else
{printf(",");},printf("\n"););LOOP(grid[i][j]=neighbor(i,j)|