Overview

Follow along with the slides or run the examples easily from here.

About

This site documents an annual lecture that I deliver to the incoming class of freshers in the school of computing at Edinburgh Napier University.

Slides

This is probably the best place to start to get an overview of things. All of the examples are from the second part of the talk (although they’re now starting to take on a life of their own).

Example #1: Hello Napier

Start our web programming journey with a variation of the tradional “Hello World”.

Example #2: Screen Interaction

Set the background of the screen to a new and pleasing colour.

Example #3: Screen Output

Output some information from JS to the screen, i.e. generate some HTML.

Example #4: Interacting with the document

Creating a simple HTML document from JS.

Example #5: Graphics: Canvas Colour

Set the colour of the background to a given colour.

Example #6: Graphics - Draw a Circle

Draw a circle on screen.

Example #7: Audio - Generate a Tone

Generate a simple audio tone at a give freqency.

Example #8: Audio - A Simple Chip-Tune

One way to play a simple melody…

Example #9: Audio - A Theremin

An effort to make a Theremin that uses the cursor position on screen to control the volume and frequency of a generated sound.

Example #10: Cellular Automata

A rudimentary Cellular Automata. It only generates a limited number of generations, but illustrates how you can use a couple of functions to interact with the screen and create dynamic output.

C64 Emulator

I mentioned the C64 as being my first real computer. For various reasons. the hardware is relatively rare these days (although still actually available to buy), but there are many really good emulators. For example, I’ve linked an online tutorial that will lead you through writing and running some simple programmes. Then I’ve embedded a copy of the WASM based C64 emulator from Tiny Emus and have provided a few one-liners to get you started.