Drag the background!

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
171 runs ♦ 1 like
By "Coding Train" p...  
Created: 4 Sep 2018
Modified: 17 Sep 2023
The random() Function
Tutorial 2.1
566 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

  • The Coding Train videos describe coding JavaScript on localhost or on the p5.js Web Editor. Some things do not apply to Ancient Brain.
  • As always, use the Docs menu for help when coding on Ancient Brain.


Get started

Enough talk. Let's start the course!
The background is a program, showing the JavaScript graphics used on this site.
The globes light up when you log in.
 
Font:

Users retain ownership of user content.

Platforms      Stats      The name      Terms and conditions

Call for partners      Contact

Call for partners!
Ancient Brain is looking for a partner to co-write a JavaScript coding book for schools, to be used worldwide. This would be a course for students in learning to code from scratch. The book and course will be integrated into the Ancient Brain site. This is an opportunity for someone looking to develop a course and textbook to partner with a site to promote it. Read more.