#include #include #include "turing.h" #include "const.h" // Turing print defines functions that take a list, take a position in that list and print the list with a pointer to that position. // It prints this vertically int length(int *List){ int i =0; while (List[i]<9){ // Por cómo construimos nuestras listas. i=i+1; } /*Anecdóticamente, el siguiente código da error. i=0; while (List[i]<=9){ i=i+1; } Y lo hace porque al asignar un trozo de memoria, si la lista tiene, p.ej., longitud 6, List[0] hasta Lista[5] son la lista de verdad, pero Lista[6] <9, y la sigue contando. */ return i+1; } void print_lista(int*L, int length, int position){ if(L==NULL || length <= position){ fprintf(stdout, "\nError en prettyprint"); } else{ int i=0; char tabs[]="\t\t\t\t\t\t\t\0"; for(i=0; i