Commit Graph

2 Commits

Author SHA1 Message Date
Pat Wick 9538db68d7 completed numberwords.py and added negatives
I completed numberwords.py, modeled after the solution that I accidentally had access
to, but I did fix a few output issues where things were printing awkwardly (thiry-zero)
so now things look to work a little more like they would be said in English. I also
(after MUCH planning, execution, debugging, and throwing it all away to start over)
came up with a way to get the negative numbers to work. I did this by converting
the original number to a string, checking if the first character is a dash, throwing
away the dash if it exists, and then completing the rest of the program as if the number
were positive. I added some conditionals and a boolean value to only print the "negative "
string on the most parent function so it doesn't end up saying something like
"negative negative fiften thousand negative four hundred and negative thirty-five", and
it seems to work for all of the numbers that I tested. It doesn't work well with
test_numberwords.py because the test cases have the tens index shifted. I guess I could
have just modified those and ran it again. I should do that.
2023-08-09 12:16:40 -04:00
pwick 01865afe8c Initial commit 2023-08-06 18:32:26 +00:00