Kit's Tetris

by Kit Krueger

14 Feb 2016

Well, that was an adventure.

It has a problem with the screen flickering like a strobe light, but I can’t seem to fix it (upon trying to go back and compare it to the original code, I found that my improvements had updated my view of the original assignment also). That aside, I reluctantly admit that I learned a great deal this weekend. The reluctance comes from the immense frustration and conviction of my own inability that accompanies the learning, but perhaps that is standard for programming. There were definitely many moments when I felt tempted to give up; leaving it alone for a little while often solved those. I wasn’t accustomed to tackling a program this complicated, and the length combined with the quantity of completely unfamiliar code was alarming. It took me a while to remember to go through line by line; seeing my comprehension grow incrementally helped with the frustration, as I could always look back and see how much more I understood. This approach actually suited the execution of the assignment well, as I could separate sections out into modules as I understood their purpose (I almost wrote ‘function’, but that means something else here). There were definitely some really delightful moments. I’ve been wondering for weeks now how to skip past the drawing step in my own programs (I tend to spend a lot of time on setup at the beginning, and running it every time gets old). Having noted that this program did precisely that, I poked through it until I found which bit was responsible.

disp.tracer(1000)
#many other things
turtle.update()

THIS CHANGES EVERYTHING. I explored the internet until I found more information on it. I don’t entirely know how the (1000) argument works, as other sources use (0,0) (or similar) and that worked when I tested it on my chessboard program, but it seems to work here. I find creating a separate dictionary module satisfying because of how neatly it separates the information. The other modules are sloppier; I’m still bothered that the movement functions don’t seem to work if they’re not in the main section (mostly I’m bothered because I don’t know why that would be). It also took some practice to get used to defining every variable in every module that uses it.

from display import*

Why does this import all of the functions but not the variables? It seems inefficient. In all, this was a highly frustrating but highly informative assignment. Next time, I shall know to plow through the hours of feeling completely stupid in the hopes that I’ll then be excited for days about .tracer, or whatever the next revelation turns out to be.

Kit is an LS student who enjoys academic libraries as well as holding coats and snickering. Find Kit Krueger on Twitter, Github, and on the web.