Sunday, October 29, 2023

Spelling Bee Solver Project

My wife loves word puzzles. She is amazing at them. Me? Not so much. On the other hand I love programs and programming projects that involved string manipulation. So when my wife started playing a new (to her) word puzzle – the New York Times Spelling Bee – my thoughts went to solving it programmatically.

If you are not familiar with the game, it involves seven letters for the player to make words from. Anny of the letters may be used but only letters from the list can be used. Oh, and there is one letter, shown in the center of the letters, that must be used in every word. Words much be four letters long or longer BTW.

NY Times Spelling Bee image

I thought this would be a fun project to code up so I took a pass at it. I think it would be a fun project for use with students as well. It involves a number of interesting and important concepts.

For one thing, you’ll want to open and read through a text file. There are many word lists available on the interne BTW. So that part is easy. You want want to check through a list for any words that are not school appropriate (that suggests other interesting projects now that I think about it).

Looping is obvious of course. As is parsing strings to find if a given letter is or is not included in a word. One method I wrote for my solution was to build a string of letters that were not included in the list of allowed letters. I searched any possible word to make sure that no unallowed letters were part of it.

Have you tried this or a similar project? Would you use this one? If you do, let me know.

Edit: Should of known it had been done before. Useful information at Nifty Assignments.

Tuesday, October 24, 2023

Last Call for CSTA Conference Proposals

The CSTA Call for Proposals is coming to an end October 30, 2023 11:59 PM PT.

Presentations are what makes the CSTA Conference is what makes CSTA the best conference for K-12 Computer Science educators.  It’s also a wonderful; audience for CS educators to present their good ideas. If you have a good idea that you have been using successfully in your classes you should think seriously about presenting to CSTA.

So think about what you have had success with and think about submitting a proposal. But act fast!

Tuesday, October 17, 2023

The More You Know The More You Expect

One thing that happens when you know who to write computer code is that you know how hard or easy some things are. If you’re even the least OCD some things that are minor, and even unnoticed to many, may bother you a little. Take this image for example.

I expect that money amounts will have two digits to the right of the decimal point. You'll notice that the second and third limes have two digits to the right of the decimal point. It turns out that those values will have two digits even if there is only a value for the tenth of a dollar and not the hundredths. So 5.10 for example. The first line will have no digits to the right if there is no value. So 0 without even the decimal point.

Now this is not really a big deal. One would think (if they were me) that since the second and third lines have the formatting I (most people?)  they would do the same for the first.

Getting the formatting "right" is easy. I know that (or at least assume that) because I have coded that sort of thing often. If I didn't know how to code it might not bother me at all. One might even assume it was hard to do.

I wonder if a lot of people assume that things are difficult and that they put up with bad user interfaces for that reason. Maybe they think things are harder than they are.  Maybe if more people understood coding they would be less likely to put up with hard to use programs.