Saturday, March 18, 2023

Finding Words With All The Letters Programming project

Does anyone else lay in bed in the morning thinking about coding projects or is it just me? I’ve been playing around with a Wordle solver helper for a while now. It helps me find words based on what I know after each guess. One of the things I like to do is see how many possibilities there are based on different hints. Yesterday I had most of the letters but not in the right place. So this morning I was wondering about words that had the same letters but in different orders. Seemed like something I needed to write some code about.  

A key method is to compare all the letters in one string with the letters in a second string. At least the way I was thinking of handling it. It struck me that that is a great assignment for students. I don’t have any students handy so I asked ChatGPT to write that function. This is the prompt I gave it:

Write a C# function that accepts two strings and returns true if all of the letters in the first string are included, in any order, in the second string. Return false if any of the letters in the first string are not included in the second string.

That is a lot like what I would assign a student. ChatGPT gave me some very nice code. It wasn’t exactly like what I was writing in my head. It used foreach and ToCharArray which is probably the best and easiest way to do this. I was coding before either of those became common so my mind goes to for and while loops and the string SubString method. This was a good reminder for me.

I left the rest of the program, which wasn’t a lot of code, to myself.

Once written I had some fun with it. For example, the letters in Alfred also makeups the word flared. The letters in face are also used in café. Some groups of letters do not make up any words of course, This seems like it could be a fun project to give students. It was fun enough for me.

Tuesday, March 14, 2023

Book Recommendations for CS People

tl;dr Book recommendations:

Overnight Code was recommended to me after I recommended Code Girls on Facebook. Overnight Code is a truly inspiring story of a woman with two strikes against her (female and Black) whose hard work, determination, and talents helped her do some revolutionary work in naval engineering and integrating hardware/software systems.

Debugging code is arguably a lot harder than writing new code. Raye Montague was amazing at debugging code and integrating disparate systems. But also a good person who helped mentor and advance others. She was given tasks that others had said were impossible to complete. Talent and hard work (Raye had a lot of both) allowed her to accomplish beyond expectations.

There is a lot of good career and life advice woven into this story as well. Advice for everyone. I could have benefited from this book early in my career.

"Code Girls: The Untold Story of the American Women Code Breakers of World War II"  was recommended by several people in a Facebook group dealing with a Kindle Challenge that Amazon is running. The idea about code breaking sparked my interest right away. This book was more than just that though.

There were plenty of insights into code breaking but the look into the lives of these amazing women was the highlight. It was a different time and women would not as respected as they should have been. Yet, these women put their considerable talents into working for the war effort and their country.

Code breaking is a fascinating subject in itself of course. I enjoyed reading about the “bombe” machines, how they were created and used. I also found the difference that code breaking made in the conduct of the war (World War II) to be interesting. This is not the sort of thing many history courses cover.

It’s easy to label these books as books for Women’s History Month or the Raye Montague book as being for Black History Month but that would be a mistake. These are books for all year long. I recommend them to anyone interested in the progression of computing in society. Code Girls is a great read for cybersecurity or cryptography students. Overnight Code is a powerful read for anyone not just computer science people. It is just that inspiring.