blob: 958eeef862e3cb680ca1ef30245f3884f369b448 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc,char *argv[]) {
int i,j;
char turns[1024]="R",append[1024],tmp[1024];
for(i=0;i<atoi(argv[1]);i++) {
strcpy(append,turns);
strcat(turns,"R");
for(j=0;append[j];j++) tmp[strlen(append)-j-1]=append[j]=='R'?'L':'R';
tmp[j]=0;
strcat(turns,tmp);
}
printf("F%s\n",turns);
return 0;
}
|