Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/isogram.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,25 @@
#include <string.h>
#include <stdio.h>

char oldletter;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move these into the method and have local variables instead of globals?

char newletter;
int count = 0;


bool is_isogram(const char phrase[]){

wihle(phrase[count] != '\0'){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type while

newletter = phrase[counter];

if (counter >= 1){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo counter

oldletter = phrase[counter -1];
if (newletter == oldletter){
printf("It`s not an isisogram!!");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls remove printfs

return false;
}
}
count++;
}
printf("It`s an isisogram!!");
return true;
}