Pencil Code Online Guide

The following sets of examples are ready to cut-and-paste into your own account. Don't just run them as-is. Take time to understand them and customize them for yourself. If you have ideas for other good examples, post them on the discussion group so that they can make their way into this area.

  1. Lines. Programming with sequences and lines and curves.
  2. Points. Dots, labels, variables and basic debugging techniques.
  3. Loops. Using the for statement to repeat code.
  4. Nesting. Nesting loops to build beautiful effects.
  5. Functions. Using -> to define your own functions.
  6. Parameters. More powerful uses of function parameters.
  7. Time. Repeating code using a simple tick timer.
  8. Output. Using write and HTML and CSS for output.
  9. Input. Using read and button for input.
  10. Numbers. How to use numbers for counting and calculation.
  11. Computation. Examples of more complex mathematical computations.
  12. Objects. Making and using objects with several properties.
  13. Arrays. Arrays are for sequences and vectors and stacks.
  14. Recursion. Recursive functions call themselves and can make amazing effects.
  15. Concurrency. Race conditions, shared memory, message passing.
  16. Sets. Multiple turtles and jQuery sets.
  17. Networking. Using resources on the web.
  18. Intelligence. Artificial intelligence, reasoning, and backtracking.

(Check back soon: more to come.)