Posts

Showing posts from December, 2021

Environment Problems

Image
I was excited to start reading a new book today. It is Tiny Python Projects. From the get go, the author wants to have you executing PyTest unit tests. Sounded legit to me. However I encountered a problem with the very first test. It complained that python3 was not a valid command. Well I am on Windows 7. My python install has a program called python. There is no python3. Easy enough. I created a python3 program that was a copy of the python one. Got past the first 2 tests. Then it bombs on the third test. The error message is not clear. The book says you will get an error message. But the book error is not the same as my error. It seems that the test is trying to issue some Linux style commands. But hello. That does not work on Windows. To be fair, the book recommends you install the "Windows Subsystem for Linux". Again, this is not going to work for my computer. WSL requires at least Windows 10. I am stuck on Windows 7. I get the feeling this book is specifically written fo...

Langton's Ant

Image
I have been going through this book that has a ton of Python projects. One that had a lot of bang for the buck was Langton's Ant. You give this ant some very simple rules to follow. Then it makes weird patterns on the screen. There are only two types of squares on the board. In my version, I made them periods and each (@) signs. Here are the rules I coded for the ant running around: On a period, turn to the right and change the spot to an @ sign. Move forward. On an @ sign, turn to the left and change the spot to a period. Move forward. That's it. This will allegedly form somewhat symmetrical patterns on the screen. Also the ant will eventually devolve to a repeating long pattern. I did not let the thing run along to confirm either of these assertions. I just enjoyed the weird patterns.