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.
- Lines.
Programming with sequences and lines and curves.
- Points.
Dots, labels, variables and basic debugging techniques.
- Loops.
Using the
for
statement to repeat code.
- Nesting.
Nesting loops to build beautiful effects.
- Functions.
Using
->
to define your own functions.
- Parameters.
More powerful uses of function parameters.
- Time.
Repeating code using a simple
tick
timer.
- Output.
Using
write
and HTML and CSS for output.
- Input.
Using
read
and button
for input.
- Numbers.
How to use numbers for counting and calculation.
- Computation.
Examples of more complex mathematical computations.
- Objects.
Making and using objects with several properties.
- Arrays.
Arrays are for sequences and vectors and stacks.
- Recursion.
Recursive functions call themselves and can make amazing effects.
- Concurrency.
Race conditions, shared memory, message passing.
- Sets.
Multiple turtles and jQuery sets.
- Networking.
Using resources on the web.
- Intelligence.
Artificial intelligence, reasoning, and backtracking.
(Check back soon: more to come.)