Why Doesn't This Sketch Run in Desktop Editor?

I found a discussion thread with an example in the P5js web editor that runs in the web editor but not when I tried copying to the desktop editor. I’m relatively new to P5js and clueless as to why it won’t run on the desktop, unless it relies on a library that I don’t have.

https://editor.p5js.org/solub/sketches/I3V99NXlX

Hello,

These are in the index.html of the P5.js:

<!DOCTYPE html>
<html lang="en">
  <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/p5.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.10.2/addons/p5.sound.min.js"></script>
    <script src="https://d3js.org/d3.v5.js"></script>
    <script src="https://cdn.rawgit.com/jwagner/simplex-noise.js/87440528bcf8ec89840e974d8f76cfe3da548c37/simplex-noise.min.js"></script
    <link rel="stylesheet" type="text/css" href="style.css">
    <meta charset="utf-8" />

  </head>
  <body>
    <script src="sketch.js"></script>
  </body>
</html>

You must add them to the index.html of your Processing p5.js editor.

And voila!

Sometimes you need a web server as well.

I use this one:
Web Server for Chrome - Chrome Web Store

Getting started:
get started | p5.js

:)

2 Likes

Thanks! I really appreciate your help.

2 Likes