David Eck's JavaScript Page
Here are some entertaining and/or educational programs, written in JavaScript so that they will work on the Web. All of the programs use HTML canvas for drawing. Most modern web browsers support it; however, you might run into some old browsers that don't. Note that in many browsers (Chrome and Firefox, at least), you can right-click a canvas and choose a command such as "View Image" or "Save Image" to save a copy of the drawing. The program should work with a touch screen, as well as with a mouse. —David Eck
- Genetic Algorithms Demo — A simulation of evolution using a genetic algorithm. You can design a "world" and see how some very simple, simulated "organisms" evolve in that world.
- Explore the Mandelbrot Set — A program for visualizing the famous Mandelbrot set, which lets you zoom in to any degree and control the colors that are used for the visualization.
- Sorting Algorithms — Watch visual demos of five common sorting algorithms, and time how long they take to sort large arrays.
- Three programs for drawing with symmetry groups in the plane:
- Wallpaper Groups — Draw symmetric patterns using any of the 17 wallpaper groups, which have translation symmetry in two independent directions.
- Frieze Groups — Draw symmetric patterns using any of the 7 frieze groups, which have translation symmetry in one direction only.
- Rosette Groups — Draw symmetric patterns using rotation and dihedral groups, which have rotation and/or reflection symmetry but no translation symmetry.
- Turing Machine Simulation — Create and run examples of the abstract computing devices known as Turing Machines. (Mostly for people interested in the foundations of theoretical computer science.)
- Pentominos Puzzle Solver — A pentomino is a polyhedron made up of five squares of the same size. This program will solve puzzles where the goal is to place the twelve possible pentominos on a board.
- xTurtle — A "turtle graphics" program that lets the user write programs and give individual commands in a made-up turtle graphics programming language.
- xLogicCircuits — A simulator for logic circuits that lets you build circuits from AND, OR, and NOT gates. Includes the ability to create subcircuits and then use them to build more complex circuits.
- xModels — A graphics program that lets users specify 3D scenes and animations in a simple scene description language. It is meant for learning about geometric modeling, not for making pretty pictures.
- xComputer — A simulator for a very simple, made-up model computer, with an assemble to convert assembly language programs into machine language and an emulator that shows the step-by-step execution of machine language instructions.
- Chaos Game — Design self-similar fractals, which are visualized by the program using a random process.
- Cellular Automata and the Edge of Chaos — Make images produced by the evolution over time of one-dimensional cellular automata, and explore the idea that the most interesting cases tend to arise when the automaton is on the "edge of chaos."
- xDataReps — A small web app that tries to illustrate various interpretations of a given 32-bit binary number.
- Three programs for graphing functions of one variable. These are not as polished as they could
be. I plan to work on a larger variety of similar programs.
- Basic Grapher — Graphs a function entered by the user.
- Families of Functions — Graphs a function that can depend on up to four parameters, with sliders for changing the parameter values.
- Derivatives — Graphs a function along with its first and second derivatives, and can draw tangent lines to the functions when the user drags the mouse on the graph.
- A few small examples, mostly for amusement: