telegrafista

This commit is contained in:
Maryna Kravtsova 2020-12-03 15:22:47 +01:00
parent 2d949666e0
commit cfe2103158

View File

@ -59,12 +59,12 @@ void search(struct morsetree* root, char* decode){
struct morsetree* this = root; struct morsetree* this = root;
int i = 0; int i = 0;
for(i == 0; i <= strlen(decode); i++){ for(i == 0; i <= strlen(decode); i++){
if((i == strlen(decode) && decode[strlen(decode)-1] == ' ') || /*if((i == strlen(decode) && decode[strlen(decode)-1] == ' ') ||
(i == strlen(decode) && decode[strlen(decode)-1] == '/' (i == strlen(decode) && decode[strlen(decode)-1] == '/'
&& decode[strlen(decode)-2] == ' ')){ && decode[strlen(decode)-2] == ' ')){
printf("\n"); printf("\n");
return; return;
} }*/
if(decode[i] == ' ' || decode[i] == '\n' || decode[i] == '\0'){ if(decode[i] == ' ' || decode[i] == '\n' || decode[i] == '\0'){
printf("%c", this->letter); printf("%c", this->letter);
this = root; this = root;
@ -72,7 +72,7 @@ void search(struct morsetree* root, char* decode){
if(decode[i] == '/'){ if(decode[i] == '/'){
printf(" "); printf(" ");
} }
else{ else if(decode[i] != ' '){
if(decode[i] == '.'){ if(decode[i] == '.'){
this = this->dot; this = this->dot;
} }
@ -82,7 +82,7 @@ void search(struct morsetree* root, char* decode){
} }
} }
printf("\n"); //printf("\n");
} }