diff --git a/puzzle1 b/puzzle1 index bc88db7..8ac3c9b 100755 Binary files a/puzzle1 and b/puzzle1 differ diff --git a/puzzle1.c b/puzzle1.c index 326a29b..779e1fa 100644 --- a/puzzle1.c +++ b/puzzle1.c @@ -11,26 +11,22 @@ char stringTwo[stringSize]; int readIntoList(char* stringList){ int index = 0; - while(1){ - char next = getchar(); - if (next != '\n'){ - stringList[index] = next; - index++; - }else{ - break; - } - } - - while (1) { - readChar = getchar(); - stringList[index] = readChar; - if (readChar == '\n' || index == stringSize-1) { - break; + while (1) + { + char next = getchar (); + if (next == '.') + { + break; + } + else if (next != '\n') + { + stringList[index] = next; + index++; } - index++; } } + int main(){ printf("enter list size: \n");