DEV Community

Discussion on: Project in Python

eddiecoyote profile image
Eddie Author • Edited on

Okay, I was wrong. I pulled out my computer, and it doesn't do anything like I thought. I keep getting declare errors between global and local variables, trying to define a function, and all that jazz. Wish I could keep working on this... but I need to get some sleep before work. It is a military deployment, after all.

This is so fun.

image of repl

eddiecoyote profile image
Eddie Author

WOO HOO! I figured it out.

I tried creating a global variable before the functions, thinking that the functions would add to the global variable by 1. Didn't work. I added the global variable in each function, but because I had declared a global variable block = int(1) at the very beginning, it was messing it up. So I took that code out and it worked like a charm. It kept repeating my basic_move() until 4 times, and then told me that I won. HUZZAH!

a picture of my repl