Impress teachers while loop?
We need to draw creative "loops." In the command line, you can see what I can enter. Which values will produce something creative that will impress the teacher and not just be a boring loop? In addition to the formula a=av, we also have a=a*3 (line 18).
How about a golden spiral? https://de.wikipedia.org/wiki/Goldener_Schnitt#Goldene_Spirale
Can you help me write this in Phython? I read through this, but I don’t know
I am not currently in Python, but have found the following on the Internet; even with turtle: https://github.com/Pirraio/Golden-Spiral/tree/main (golden_spiral.py)
Hope that helps; otherwise I will look again.
Sure. As you design the loop or the loop condition is completely left to you. It is only to be observed that outer syntactic structure:
There are, for example, loops that go backwards, with more complex or non-variable conditions, continuous loops with termination condition etc. The displayed is just a simple example based on the linked code.
Thanks for the first time that makes sense and is logical. Can’t you do * instead of i=i+1? This is the distinction between arithmetic and geometrical loops, right?
Okay, well, let’s start thinking.
is nothing but:
which in turn is nothing but:
By the way, there are also good online dossiers where you can try it directly in the browser, e.g.:
I can’t change it and we haven’t had it yet in class
Yeah, so? Each While loop can be easily converted into a For loop and vice versa.
Okay, sorry. We need to work with while and not with for
What do you mean no code? The code is in the file I named: https://github.com/Pirraio/Golden-Spiral/blob/main/golden_spiral.py
There’s no code in there. I understand how the loop has to be built.
try rectangular loops, perhaps crisp loops or wavy loops
you can cut angular loops through straight lines interrupted by 90° turns
wavy loops can make with the sine
ajkcdajefiu~
Sinus sounds exciting. Can you help me with the jumps what the code has to look like?
the other you probably need to tweaked, but an approach would be in line 17 “lt(math.sin(i)), i is a continuously increasing variable (“i += 1” in the loop) to generate the wave effect
Don’t forget to import the math library!
ajkcdajefiu~
you can stretch the wave or scuba with a prefactor, maybe you can do better?
ajkcdajefiu~
Now it’s a line 😅
Probably you would impress your teacher the most (and probably take you very positively from the rest of the class) if you actually do your homework yourself.
Okay, I don’t care
Yeah, you know…
hm, right
I don’t understand what interests you? You don’t know me