Open boryanagoncharenko opened 1 month ago
The issue seems to be that Skulpt stops the program when a time.sleep() is encountered (and there is one added at the end of the for-loop body). This seems to have been an issue before https://github.com/skulpt/skulpt/issues/764 but it should have been already addressed. Not sure if the issue persists in our fork.
We could:
The issue seems to be that Skulpt stops the program when a time.sleep() is encountered (and there is one added at the end of the for-loop body). This seems to have been an issue before skulpt/skulpt#764 but it should have been already addressed. Not sure if the issue persists in our fork.
We could:
- Try syncing with the latest version of Skulpt and/or attempting to fix the matter there.
I am ok with trying that but we should totally check with @jpelay whether/how that would impact us since we did a lot of work on top of Skulpt with the debugger.
- Just remove all time.sleep statements from the body, even though that might lead to some confusion in the output.
Do you mean only in the if_pressed
or in general? It is potentially a bit confusing but if it solves this problem, I am ok with it (how often, in practice are kids going to put a loop within an if statement) But if you mean in general, that would be a no for me because the small wait is very helpful!
I am ok with trying that but we should totally check with @jpelay whether/how that would impact us since we did a lot of work on top of Skulpt with the debugger.
Actually, I just checked that syncing the fork would not resolve the issue. The problem still exists in Skulpt and can be reproduced with the following programs:
import turtle
t = turtle.Turtle()
for c in ['red', 'green', 'yellow', 'blue']:
t.color(c)
t.forward(75)
t.left(90)
time.sleep(1)
and
step = 1
while step < 4:
step = step + 1
print('test')
time.sleep(1)
Do you mean only in the
if_pressed
or in general? It is potentially a bit confusing but if it solves this problem, I am ok with it (how often, in practice are kids going to put a loop within an if statement) But if you mean in general, that would be a no for me because the small wait is very helpful!
Yes, I meant removing the time.sleep only for commands placed in an if-pressed statement. Ideally, I'd find a way to keep the delay because it is handy, but I agree this might be an overkill for now.
Actually, I just checked that syncing the fork would not resolve the issue. The problem still exists in Skulpt and can be reproduced with the following programs:
Yeah, that's what I was going to say. Our version of Skulpts dates late 2023, and this issue is from 2018.
Yes, I meant removing the time.sleep only for commands placed in an if-pressed statement
I am ok with that!
Describe the bug In level 10, the following code should output all elements of the list if the key x is pressed. However, the for loop outputs the first element of the array and then the program stops:
Add a screenshot (optional)