How to stop a skript like trinket.io does

51 views
Skip to first unread message

Björn T

unread,
Feb 3, 2019, 10:01:02 AM2/3/19
to Skulpt
First of all: Thank you for your great job.

I have made a skulpt project for my students. When somebody made an infinite loop, the browser crashes and the code is gone. That is very frustrating for that student. I want to add a stop button like this one on trinket.io (https://trinket.io/python). I tried to understand their code, but got stucked.

I followed the instructions on skulpt.org to getting started with skulpt.

Any ideas?

By the way: The example on the site http://www.skulpt.org/static/developer.html about adding a module got a little bug. The line
return myfact(a);
should be
return myfact(a.v);

Björn T

unread,
Feb 4, 2019, 2:25:49 PM2/4/19
to Skulpt
i = 0
while True:
   
print(i)
    i
= i + 1

This is an example, that crashs the browser. I think I have to use suspensions but didn't get the point where to start.
The scipt starts printing after i stoped the browser, but it should printing all the time.

Reply all
Reply to author
Forward
0 new messages