diff --git a/main.c b/main.c index aaa3380..41c72f4 100644 --- a/main.c +++ b/main.c @@ -120,6 +120,8 @@ t_ttr ttr_tamplates[19] = "...." } }; + +// read from file. Returns string. char *read_file(char *path) { int fd; @@ -147,6 +149,7 @@ char *read_file(char *path) return (string); } +// Split string to table by newline character. Each string contain one line of the file char **to_table(char *string) { char **table; @@ -157,6 +160,7 @@ char **to_table(char *string) return (table); } +// Test func. Print string table. void print_table(char **table) { int i; @@ -172,6 +176,7 @@ void print_table(char **table) } } +// Test func. Print table but one string contain whole figure. void print_one_string(char **glued) { int i; @@ -193,6 +198,8 @@ void print_one_string(char **glued) } } +// This function creates string table in which one line represent one figure +// by "glueing" evry 4 strings from table char **glue_figure(char **table) { int i; @@ -224,6 +231,8 @@ char **glue_figure(char **table) return (ttr_table); } +// Moves figures to top left corner. +// table contains strings each represent one figure void move_up_left(char **table) { int i; @@ -259,6 +268,7 @@ void move_up_left(char **table) } } +// convert "#" symbols to letters void to_letters(char **ttr) { char ch; @@ -281,6 +291,8 @@ void to_letters(char **ttr) } } +// Test func. Compare figures from file +// with templates void test_check(char **ttr, t_ttr *tamplates) { int i; @@ -304,6 +316,8 @@ void test_check(char **ttr, t_ttr *tamplates) } } + +// Forgot for what this func was added:) int ft_dumb_sqrt(int nb) { int i;