Python Coding - Some more turtle stuff
This past week consisted of a lot of head scartching and temper tantrums but, ultimately, made for an extremely satisfying project. My level of expertise with python was limited to crunching some data from imported excel files. I had never really wrote code that involved an active display. Prior to this project, I thought that in order to make things moves and interact, I would need to use Javascript code. However, Python seems to be able to do it all to some extent! I wrote my code on Replit and utilized various internet searches in order to resolve my issues and perform the desired displays. Here is a video of my final product!
This activity involved a lot of trial and error. One of the more unique things I am proud of myself for figuring out was changing the background color. I did this by creating a variable, 's', and using turtle.getscreen(). This allows me to mess with the background color. However, I could not figure out how to get rid of that little arrow in the center of the screen. I know it relates to this function as it goes away if I remove this function. I used a series of color changes, "turtle dances", erasing using different pen colors, and writing using set position, right, left, forward, and circle. The one thing I am still working on is figuring out how to set the tilt angle so that you can reset the turtle between each letter. My attempts consisted of a reset function, which ended up resetting the whole screen, and the settiltangle function which would not work. I am wondering if the online instructions can vary based on the version of Python being used. Either way I was able to get a pretty cool result!
Kevin...this. is. magnificent! I can't even begin to imagine how much went into this piece of coding. Wow!
ReplyDeleteThanks! It was fun - looks kind of like a little show. Also, I figured out that for colors across most of the functions, all that had to be done was calling the color name vs working with shades from 0-255. Once I figured that out, it was quick to jump from one screen to the next (or at least give the illusion!)
DeleteKevin,
ReplyDeleteI echo January's awe and appreciation.
And I agree that you were "able to get a pretty cool result."
If you can share your code, I can help you get rid of that pesky turtle.
That would be great! I think I shared the replit with you properly. Just in case, here is the link... https://replit.com/join/owidnvpi-kevinanton
DeleteThank you!
Thanks. I look forward to reviewing your code.
ReplyDelete