diff options
Diffstat (limited to 'src/bin/dragonturn.c')
-rw-r--r-- | src/bin/dragonturn.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bin/dragonturn.c b/src/bin/dragonturn.c new file mode 100644 index 0000000..a12bb97 --- /dev/null +++ b/src/bin/dragonturn.c @@ -0,0 +1,14 @@ +#include <stdio.h> +#include <string.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); +} |