Introduction to Programming

This is a course in Introduction to Programming, using JavaScript as the programming language. It is suitable for people who have never programmed before.

This is based on the excellent video series: Code! Programming with p5.js by Daniel Shiffman at The Coding Train. This course uses the P5 JavaScript graphics library.

The Shiffman code has been ported (with permission under MIT licence) to Ancient Brain "Worlds" that can be run and edited on Ancient Brain in the browser. You can edit the Worlds directly from inside this course. On Ancient Brain, you can clone, edit, run, host, share, like and embed these Worlds. You can upload your own resources (images, music, etc.) to use in these Worlds.

When you are finished the first part of this course, you will be able to make Worlds like the following. Click to run them.

Tutorial 2.5
160 runs ♦ 1 like
By "Coding Train" p...  
Created: 4 Sep 2018
Modified: 17 Sep 2023
The random() Function
Tutorial 2.1
545 runs ♦ 1 like
By "Coding Train" p...  
Created: 4 Sep 2018
Modified: 17 Sep 2023
Variables in p5.js (mouseX, mouseY)


Before you start: Do the Ancient Brain Tutorial

Before you start, do the Ancient Brain Starter Tutorial. This shows you how to use this site.


Contents

  1. Code! Programming with p5.js
  2. p5.js Web Editor
  3. Shapes & Drawing
  4. Color
  5. Errors & Console
  6. Code Comments
  7. Variables in p5.js (mouseX, mouseY)
  8. Variables in p5.js (Make your own)
  9. JavaScript Objects
  10. The map() Function
  11. The random() Function
  12. Introduction to Conditional Statements
  13. The Bouncing Ball
  14. Else and Else if, AND and OR
  15. Boolean Variables
  16. while and for Loops
  17. Nested Loops


Notes


Get started

Enough talk. Let's start the course!
Step 1 of 17