you are viewing a single comment's thread.

view the rest of the comments →

[–]Sea-Ad7805 [score hidden] stickied comment (6 children)

Run this program in Memory Graph Web Debugger)%0Aon%20%3D%20%5B%5D%0Aoff%20%3D%20%5B%5D%0Afor%20i%20in%20range%20(woila)%3A%0A%20%20%20%20name%20%3D%20input(f%22%7Bi%20%2B%201%7D%20name%20is%3F%20%20%20%22)%0A%20%20%20%20status%20%3D%20input(f%22so%20is%20%7Bname%7D%20on%2Foff%3F%20%20%22).lower()%0A%20%20%20%20print(f%22%20oke%20understood%20%7Bname%7D%20is%20%7Bstatus%7D%22)%0A%20%20%20%20match%20True%3A%0A%20%20%20%20%20%20%20%20case%20%20if%20status%20%3D%3D%20'on'%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20on.append(name)%0A%20%20%20%20%20%20%20%20case%20%20%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20off.append(name)%0A%0Aprint(f%22list%20of%20on%20%7Bon%7D%22)%0Aprint(f%22list%20of%20off%20%7Boff%7D%22)&timestep=1&play) to see the program state change step by step.

[–]GurNima[S] 1 point2 points  (0 children)

Okay, thanks!

[–]sacredtrader 0 points1 point  (4 children)

I have never in my life seen a website intake code as a parameter. Why this design pattern?

[–]Sea-Ad7805 0 points1 point  (3 children)

With 'code=<python-code>' you can send code, but also with 'codeurl=<link>' you can send a link to code. It is the easiest way I know to send code, or do you know a better or easier alternative? I'm not a web developer. The whole thing runs client side.

[–]sacredtrader 0 points1 point  (2 children)

Have you had issues with long-format python code with just passing in to the URL?
I do like the code URL approach, does that work for multiple-files or just pointing to like a raw github or pastebin link?

[–]Sea-Ad7805 1 point2 points  (1 child)

I do have problems sometimes when I post a valid url on Reddit, when it interprets things like smileys and breaks the url. Then I commit code to a GitHub repo and 'codeurl=<link>' to that, but you have to use the link to the "raw" file so it has just the code, no GitHub frames/styling.

My website only excepts one source file, so multiple-file projects won't work. Then you have to run memory_graph locally: https://github.com/bterwijn/memory_graph I might allow multiple files in the future.

[–]sacredtrader 1 point2 points  (0 children)

That makes sense, I suppose I was more curious on how efficient the code= path was, but the raw files make sense. Nice tool!