+ 5
Maybe using Threads but as ChaoticDawg suggested in your previous question: "threading" module is not supported by Skulpt.
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 How can we add it?
+ 2
Try adding the steps for each turtle in a list of two columns and just iterate through it row by row. It won't be "at the same time", but nothing will, in reality :)
+ 2
https://code.sololearn.com/WdDh6O886ywz/?ref=app
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥:
usage summary in playground and/or code comments ;)
+ 1
Yes...
It wasn't obvious at all to have more than one instance of skulpt at one time, but finally I successed by open them in two iframes (my code should support any number of instances, automatically created based upon the number of '.sk-ifrm' (iframe) class present in the code...
However, that make me think I don't have filtered the result, so applying this class name to any not iframe element would make it not working ^^
+ 1
Study my code (html and window onload event, not necessary to dive into the loadMultiSk_factory IIFE ;)) and try to figure how that work for two turtle, attempt to add first only one turle instance... now I'm too tired (I'm working on it since many hours) to give more help / detailed explanation: my brain needs to rest ;P
0
The limitation is now corrected (filtering of only 'iframe.sk-ifrm' css query selector ;)
Roughly, you can add any number of instances of skulpt, based on this template... you only need to add the right number of iframe and the right number of <div> targets of skulpt turtle output (container of canvas dynamically created by skulpt), childs of <div id="canvas-wrapper"> and initialize each as in the onload handler...in the function used as onload first callback of the loadMultiSk() main function (wich do the intialization of the iframes content ;)



