quil / quil-site

Source code of quil.info
http://quil.info
Eclipse Public License 1.0
7 stars 13 forks source link

Clarify how to get starting drawing something #15

Closed uvtc closed 5 years ago

uvtc commented 8 years ago

For running quil on Clojure, the quil.info webpage says, "3. Open src/my_sketch/core.clj, and evaluate it.", but it's not clear what "evaluate it" means.

I've run lein new quil my-art and cd my-art. I look at src/my_art/core.clj. It contains functions setup, update-state, and draw-state. It also has a q/defsketch. I run lein repl, but nothing happens.

How do I get that code to run so a drawing appears? The website should explicitly explain how to do that.

uvtc commented 8 years ago

Ok. I now see that I can run (use 'my-art.core) and the window pops up running the demo code.

If I then edit the demo code, and run (use :reload 'my-art.core), I see that a 2nd window pops up showing my changes. So, with this simple workflow, looks like I need to:

  1. edit code
  2. close existing window
  3. (use :reload 'my-art.core), and window comes up again with my changes.
  4. goto step 1
nbeloglazov commented 8 years ago

Added link to more detailed tutorial. Hope this'll make it easier to start.

vsvasya commented 5 years ago

It is also very unclear what to do if nothing happens :) After carefully doing all steps of tutorial repl command just returns nil, and no graphics windows appears.

my-art.core=> (use :reload 'my-art.core) nil

clojure 1.9.0, quil 2.7.1, java-8-openjdk-amd64, Ubuntu 17.04

nbeloglazov commented 5 years ago

Have you created my-art using lein new quil my-run? If so - yes, there is a bug: template was changed but instructions weren't updated. To run the project try the following:

lein run

or

lein repl
my-art.core=> (use :reload 'my-art.core)
my-art.core=> (-main)

I should update docs or probably rollback template change so that it works by just reloading namespace.

vsvasya commented 5 years ago

Yes, like in tutorial I created project with lein new quil my-art.

Both lein run and (-main) in repl works! Thank you)

nbeloglazov commented 5 years ago

Updated template so it works by evaluating clj file which is more inline with standard quil/clojure flow.