/*A stupid str2bf converter!*/ #include #define MAX 100 int win=10; char cell[MAX]={0}; int curr=0; /*Find a number as a multiple of ten */ void divmod(int num,int *div,int *mod) { *div=num/10; *mod=num%10; } /*Finds a cell closer then 10 cells away which has a value near to the value which you have to print*/ int find_closest(int *val,int *pos,char c) { int i,flag=0; for(i=curr-10;i=-10){ *val=cell[i]-c; *pos=i; flag=1; break; } } if(!flag) return 0; return 1; } /*Moves to an empty cell*/ void on_empty_cell() { while(cell[curr]){ putchar('>'); curr++; } } void bf_gen(char c) { int div,mod; int s,i,tmp; int seek,seek_ptr,pos,val; int win_cell; char t,mutate; divmod(c,&div,&mod); /*Suppose you have to print 'b' and the value of just the previous cell is 'a' then you *don't need to reduntatly generate a loop for it all you have to do is:- *<+. and BANG! *This is what this piece of code does */ if(find_closest(&val,&pos,c)){ seek=(curr':'<'; curr=pos; for(i=0;i++++++<-]>. BANG! * Now that is what this long block do! */ else{ on_empty_cell(); win_cell=curr; for(i=0;i'); for(i=0;i