Description #
Pencil Code is an educational platform that allows students to write code using both blocks and text. It supports turtle graphics and multiple programming languages, making it a bridge between visual and text-based programming for learners of all ages.
History #
Pencil Code was created by David Bau, a Google engineer, as part of an effort to make programming more accessible and creative for kids and educators. Released in the early 2010s, Pencil Code gained popularity in schools for its dual-mode interface (blocks and text) and support for real programming languages like JavaScript, CoffeeScript, and Python.
Hello World Code #
write "Hello, World!"
You can also switch to block mode and drag a write
block onto the canvas.
How to Run #
Option 1: Online (Recommended)
- Visit https://pencilcode.net
- Create a new sketch or remix an existing one
- Choose between block or text mode
- Click Run to execute
Option 2: Local (Advanced)
- Download and run Pencil Code from the GitHub repo
Key Concepts #
- Dual-mode: block and text coding
- Turtle graphics and canvas drawing
- Supports multiple languages (CoffeeScript, JS, Python)
- Built-in
write
andmove
commands - Great for storytelling and creativity
- Seamless transition from blocks to syntax
- Online IDE with save and share features
- Keyboard and drag-friendly interface
- Used in K–12 education
- No installation required for most users
Try It Online #
Fun Facts #
- Pencil Code supports musical coding, letting users compose songs with code.
- Teachers can set up custom classes and manage assignments using Pencil Code.
- Its “Remix” feature allows collaborative experimentation.