Drag the background!

AI programming exercises

A series of online AI programming exercises. For use in any AI course.

Each step has: (a) a running online program to implement some AI concept, (b) a video introduction, (c) notes to explain the program, and: (d) exercises for students to do. Students can edit and run these programs in the browser, with no install.

These exercises are based on AI programs by Daniel Shiffman of The Coding Train and The Nature of Code. Ported with permission under MIT licence.

The exercises involve making modifications to a series of AI programs (called "Worlds" on Ancient Brain), including the following Worlds. Click images to run them.

Breadth-first se...
3420 runs ♦ 0 likes
By "Coding Train" p...  
Created: 30 Apr 2019
Modified: 17 Sep 2023
Breadth-first search with a Force-directed graph.
Character recogn...
2070 runs ♦ 0 likes
By "Coding Train" p...  
Created: 5 Jul 2019
Modified: 17 Sep 2023
Neural network to do character recognition from image database and from handwriting in real-time.
A star
4999 runs ♦ 2 likes
By "Coding Train" p...  
Created: 1 May 2019
Modified: 17 Sep 2023
"A Star" algorithm to find shortest path through maze.
GA (Finnegans Wake)
1132 runs ♦ 0 likes
By "Coding Train" p...  
Created: 2 May 2019
Modified: 17 Sep 2023
Genetic Algorithm to write the first line of Finnegans Wake.


Before you start: Do the Ancient Brain Tutorial


Contents

  1. Binary tree
  2. Breadth-first search
  3. Breadth-first search (graphical)
  4. A* search
  5. Genetic Algorithm
  6. Genetic Algorithm for TSP
  7. Perceptron
  8. Neural network for XOR
  9. Character recognition neural network


Bonus World: Chat GPT

The following World calls the OpenAI API to talk to GPT-3.5.
We do not have exercises for this World but you could think of some:


Chat with GPT model
1013 runs ♦ 3 likes
By Starter user  
Created: 18 Sep 2023
Modified: 3 Oct 2023
JavaScript page to chat with a GPT model. Calls OpenAI API. User needs to enter API key.


Credits


Notes

  • Code runs on the Ancient Brain platform. Students copy, edit and run the code in the browser, with no install.
  • Students are given coding challenges in the notes.
  • Teachers can run and examine student code in the browser, with no risk, and no install.
  • These exercises have already been used in an M.Sc. course in AI.
  • As always, use the Docs menu for help when coding on Ancient Brain.


Preview

As a preview, here is the video for the Genetic Algorithm exercise.

Notes on videos

  • Maximise video to see text and code clearly.
  • Some videos may show an older version of the site. You will work it out.
  • The videos feature Dr. Mark Humphrys of Dublin City University. They were made originally for an M.Sc. course.
  • They contain a few things that do not apply outside of the M.Sc. course. You will work it out.
  • Credit to Ideas Lab at DCU for their superb video editing.


AI exercises, not an AI course

This is not a full AI course. It does not introduce you to AI theory, which would be a huge undertaking. To learn AI theory, you need to do a course elsewhere.

Rather, this is a series of AI programming exercises that teachers and lecturers can use in AI courses, and that students can use to try out the AI theory they have learnt.


Get started:

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.