aima-javascript
Javascript implementation of algorithms (and visualizations) from Russell And Norvig's "Artificial Intelligence - A Modern Approach"
Some Javascript visualizations that I admire, and would like to see similar kinds of things here:
- Red Blob Games: A* Tutorial
- Qiao Search Demo
- Nicky Case: Simulating the World
- Rafael Matsunaga: Genetic Car Thingy
- Lee Yiyuan: 2048 Bot
Prerequisites
- Node.js version 0.10.0 or newer
- Install jspm, eslint, gulp globally
npm install -g jspm
npm install -g eslint
npm install -g gulp
Installation
To run locally for development.
- run
npm install
- run
jspm install
Running
Start a local server, e.g. python -m SimpleHTTPServer
for Python 2.x or python -m http.server
for Python 3.x
Then visit localhost:8000
using your browser.
Deploying
To bundle the web app
- run
gulp bundle
followed bygulp copy
to bundle the app into build folder - Either serve
build
folder locally. - Or deploy it to gh-pages by running
gulp deploy
.
build
This directory contains the minified source code for production deployment.
Structure
The repository has the following structure:
- There is a directory for each chapter
- Each algorithm will have a
algorithm.js
where the main logic is to be implemented. - Each algorithm will also have a
c_algorithm.js
which will have the javascript visualization. - The
index.html
will include both the scripts. - The
c_algorithm.js
will use AJAX to loadalgorithm.js
intoindex.html
as plain text for side-by-side reference of the reader. - The
index.html
will also includemain.js
which contains minified version of global scripts like jQuery, angular etc - See the
index.html
of chapter 2 for reference.
Contribution
Put the name of the chapter you want to contribute in the Division of work thread. Please squash all comits into a single comit.