Commit graph

33 commits

Author SHA1 Message Date
136abce9bf Cleaned up formatting. Removed an unused comparison in the for loop responsible for printing the histogram. 2025-08-22 18:24:08 +00:00
14730549f1 Push final version of ex1_13 to repo, as only the skeleton was included in the initial commit by mistake. 2025-08-21 11:52:11 -07:00
296d1157a0 Completed exercise 1-13, with a bonus version that trades an extra 4 bytes in memory for an equally miniscule perfomance gain at execution. 2025-08-19 17:45:32 -07:00
4b03274352 Skeleton prototype for exercise 1-13. 2025-08-19 13:58:39 -07:00
dbf602e13d Implemented KNR C Exercise 1-12, reusing mostly modified code from my previous (optional) implementaiton of KNR C's example wordcounting program. 2025-08-16 02:14:40 +00:00
2523043172 Nearly direct copy of a word count program from KNR C, mimicked here only so that I could compare the size of the resulting binary once compiled to my own solution, archived as ex1_10-5.c (ex1-10.5). The resulting binary, as compiled with GCC, was 136 lines long, 2 lines shorter than my own. Challenge failed :sigh:. Good exercise, though; I'll come back to this and study why later. 2025-08-16 02:07:42 +00:00
313e4aaa3b Added ex1_10-5.c, an implementation of an example wordcount program on pages 21/22 of KNR C, purely as an exercise to see if I could do it more efficiently than the book. This resulted in a binary that was, 138 lines long as disassembled. 2025-08-16 01:53:43 +00:00
d3ce211f14 Implemented a suggestion from Affine to replace the many if statements with a single switch and only ever call getchar at one point in the code. 2025-08-14 22:32:02 +00:00
43f172da21 Cleaned up unnecesary curly braces. 2025-08-14 22:07:31 +00:00
b466a300d0 Annotation updates. 2025-08-14 22:05:46 +00:00
2638922bbe Untested initial version of code for visibility. 2025-08-14 21:54:38 +00:00
635a8300a3 Implemented suggestions from affine. Considerably simplified the program by removing initialization for 'a' prior to loop entry; 'a' is now declared as the initialization expression for the loop, performing a getchar at the same time and preventing a null byte from being printed as the first character (even though this was not visible to the user). 2025-08-14 20:02:00 +00:00
abc0ac1660 Rewrote while loop as a for loop to reduce overall program size. 2025-08-14 19:52:12 +00:00
d6f81778ef Completed and improved ex1_10 using a switch function. 2025-08-14 19:23:28 +00:00
d3262419a8 Added comments to explain certain code behaviors in ex1_10.c so that they can be read and referred to later more easily. Future code should be properly annotated on initial commit. 2025-08-14 17:42:15 +00:00
1ac53c22b2 Minor change to reprint a single \ as \ instead of \. 2025-08-14 17:29:11 +00:00
bbf858134c Initial incomplete implemenation of exercise 1-10. Current version only reprints tabs to \t and backslashes to \ rather than the intended behavior of doing that in addition to reprinting backspaces as \b. Bug is due to not capturing backspaces as input. Fix pending. 2025-08-14 17:27:43 +00:00
84a9263691 Added a solution of 1-9 developed collaboratively by both of us <3 2025-08-14 07:15:51 +00:00
7d26e0ffc7 Implementation of exercise 1-9: copying and printing input text to output, removing redundant spaces. 2025-08-14 06:53:38 +00:00
7be84d6b88 Complexted exercise 1-8; count and report number of newline, tab, and blank characters in input. 2025-08-13 07:16:39 +00:00
7682f93933 Delete dumbtest.c
Removed in favor of ex1_7.c
2025-08-13 05:48:26 +00:00
a36892d8be Changed name of dumbtest.c to ex1_7.c to reflect what exercise was completed in this code. 2025-08-13 05:46:40 +00:00
9ed3796014 Changed 'c' to 'a' while working on other, later abaondoned changes. 2025-08-13 05:44:14 +00:00
191b35631c Modifications and bugfix to prevent the program from returning an error code on exit. 2025-08-09 23:14:04 +00:00
6860b93049 Added dumbtest.c to demonstrate a test for the boolean value of != EOF. Numerous modifications to ex1_6-getchar.c to that end before dumbtest.c became its own project- most modifications reverted. 2025-08-09 23:12:19 +00:00
93d53163f8 sync minor code change 2025-08-07 23:42:52 +00:00
79b0940502 Implemented exercise 1-6 for additional testing and modification. 2025-08-07 23:25:33 +00:00
fc658ddb69 Bugfix for a spin caused by setting the value of fahr inside the for loop when it is now initialized at loop start. 2025-07-29 17:00:35 -07:00
61e32d0e22 Reformatted declarations for some floats to more modern standards. 2025-07-29 16:57:11 -07:00
f42b5d0b09 Re-implementation of exercise 1-2 as a for loop instead of a while loop and simplified printing and calculation into a single statement as demonstrated in section 1-3. 2025-07-29 15:06:59 -07:00
44dff59271 Implemented the objectives of Exercise 1-3 to ex1_1-tempconverter.c and then implemented the objectives of Exercises 1-3 and 1-4 to ex1_4-tempconvertercf.c. 2025-07-29 14:44:47 -07:00
357347ae6e Add both header for the entire table, and individual headers denoting which column is which unit. 2025-07-29 14:17:11 -07:00
67483eaceb Initial commit for KNR C exercises 2025-07-29 13:06:28 -07:00