a gleam implementation of a CS assignment originally written in cpp
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: update coversheet

+66 -52
+64
COVERSHEET.md
··· 1 + --- 2 + Project: "#6" 3 + Professor: "Professor Knoerr" 4 + Class: "CS 1210 – Fall 2025" 5 + Author: "Kieran Klukas" 6 + --- 7 + 8 + # Requirements 9 + 10 + <!--Restate the problem specifications in your own words--> 11 + 12 + Search a provided old testament text file for arbitrary reference. It prompts the user for book, chapter, and verse and then searches for that verse. If book is not found then output `Book does not exist in the Old Testament`. If chapter isn't found then `Chapter # does not exist in Book`. Finally if the verse isn't found then output `Verse # does not exist in Book #`. Once the verse is found then append the verse to `verses.txt`. 13 + 14 + # Design 15 + 16 + <!--How did you attack the problem? What choices did you make in your design, and why?--> 17 + 18 + I started with outlining the basic input system [`532c6cf`](https://github.com/cu-cs1210/lab-6-kieranklukas/commit/5b2ced23798fc7cbce79eb445c9592cccf16d6a6). Then worked on setting up a while loop to read the file line by line. I spent a while puzzling over exactly how I wanted to implement this and I am not entirely satisfied with my current solution. It would be interesting to try this problem in a functional language like gleam or erlang and see how much more cleanly I can parse the file. I implemented each reference part sequentially and then went back and made it check for barrier strings to stay within the proper book and chapter. I ended up realizing that the book of Psalms is referenced differently and so made some logic to permit its idiosyncracies [`7c18fff`](https://github.com/cu-cs1210/lab-6-kieranklukas/commit/7c18fffa30ab3e43bcb05ad4dff44f275987cbb8). 19 + 20 + # Implementation 21 + 22 + <!--Outline any interesting implementation details.--> 23 + 24 + I used a single input variable to parse the file word by word until we get to the correct verse. I also check if the input book is listed as `Psalm` or `Psalms` and add or remove an `s` when doing checks or output as appropriate. The output file is also never opened until we find the verse and is immediately closed afterward. Also a minor note of intrest is that you can change the default paths that the program loads from and saves to by adding the paths as arguments (eg. `lab66 test/OT.txt build/verses.txt`). 25 + 26 + # Testing 27 + 28 + <!-- 29 + Explain how you tested your program, enumerating the tests if possible. 30 + Explain why your test set was sufficient to believe that the software is working properly, 31 + i.e., what were the range of possibilities of errors that you were testing for. 32 + --> 33 + 34 + I updated the `makefile` to add `make run` so I could compile and run it more easily and updated the test file to have the Zylabs test states as well as more granularly check a happy path and some adversarial paths. 35 + 36 + # Outside Help 37 + 38 + <!--Did you get help from anyone else on this project? Document their contribution to your learning.--> 39 + 40 + No outside help was used beyond minor googling for how to capitalize an entire string and the proper syntax for appending (not covered in zybooks as far as I can tell but I'm sure you will cover it in lectures next week). 41 + 42 + # Summary/Conclusion 43 + 44 + <!--Present your results. Did it work properly? Are there any limitations?--> 45 + 46 + The program works well and should cover most edgecases! As far as I can tell there isn't anything that should be able to break it beyond changing the `OT.txt` to be several GB in size. 47 + 48 + # AI Use 49 + 50 + <!--How did you use Generative AI in this project?--> 51 + 52 + I used claude to generate a more complex test file and then modified it to add the rest of the zybooks tests as I got closer to finishing the project. 53 + 54 + # Lessons Learned 55 + 56 + <!--List any lessons learned. What might you have done differently if you were going to attack this again.--> 57 + 58 + I would definetly want to try a different language for sure if I was doing this independantly but overal I think this implementation is fairly solid and I wouldn't change much. I did find out in this lab that it is always a good idea to check the whole input or you might run into weird bugs like how `PSALMS` is formatted. 59 + 60 + # Time Spent 61 + 62 + <!--Approximately how many hours did you spend on this project?--> 63 + 64 + ![hackatime badge](https://hackatime-badge.hackclub.com/U062UG485EE/lab-6)
-52
coversheet.md
··· 1 - --- 2 - Project: "#6" 3 - Professor: "Professor Knoerr" 4 - Class: "CS 1210 – Fall 2025" 5 - Author: "Kieran Klukas" 6 - --- 7 - 8 - # Requirements 9 - 10 - <!--Restate the problem specifications in your own words--> 11 - 12 - # Design 13 - 14 - <!--How did you attack the problem? What choices did you make in your design, and why?--> 15 - 16 - # Implementation 17 - 18 - <!--Outline any interesting implementation details.--> 19 - 20 - # Testing 21 - 22 - <!-- 23 - Explain how you tested your program, enumerating the tests if possible. 24 - Explain why your test set was sufficient to believe that the software is working properly, 25 - i.e., what were the range of possibilities of errors that you were testing for. 26 - --> 27 - 28 - I updated the `makefile` to add `make run` so I could compile and run it more easily and updated the test file to have the Zylabs test states as well as more granularly check a happy path and some adversarial paths. 29 - 30 - # Outside Help 31 - 32 - <!--Did you get help from anyone else on this project? Document their contribution to your learning.--> 33 - 34 - # Summary/Conclusion 35 - 36 - <!--Present your results. Did it work properly? Are there any limitations?--> 37 - 38 - # AI Use 39 - 40 - <!--How did you use Generative AI in this project?--> 41 - 42 - I used claude to generate a more complex test file and then modified it to add the rest of the zybooks tests as I got closer to finishing the project. 43 - 44 - # Lessons Learned 45 - 46 - <!--Present your results. Did it work properly? Are there any limitations?--> 47 - 48 - # Time Spent 49 - 50 - <!--Approximately how many hours did you spend on this project?--> 51 - 52 - ![hackatime badge](https://hackatime-badge.hackclub.com/U062UG485EE/lab-6)
+2
src/lab66.cpp
··· 43 43 getline(cin, book); 44 44 for (int i = 0; i < book.length(); i++) 45 45 normalizedBook += toupper(book[i]); 46 + if (normalizedBook == "PSALMS") 47 + normalizedBook == "PSALM"; 46 48 47 49 cout << "the chapter: "; 48 50 cin >> chapter;