Tag Archives: simulation

An Orbital Maneuver Simulator in JavaScript

Below is a prototype of a simple orbital maneuver simulator in JavaScript. To see the code in action, copy it into an .html file and open that file in a web browser that runs JavaScript. Or, for an online version, … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

A Simulation of Pest Eradication in JavaScript

The JavaScript code below, when run, simulates a ecological pest-eradication scenario. An exterminator chooses a target at random, travels over a network of links and nodes to get as close as possible to the target, moves off the network towards … Continue reading

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Simulating Hardware in VHDL Using GHDL

Follow the steps below to create a simple “Hello, World” program in VHDL using GHDL. VHDL, or “VHSIC Hardware Description Language”, is a programming language used to simulate the operation of computer hardware in software.  It provides a standardized method … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

A Network Routing Simulation in JavaScript with the Bellman-Ford Algorithm

The JavaScript code below, when run, simulates routing of packets within a simple computer network using the Bellman-Ford routing algorithm. To see it in action, copy it into an .html file and open that file in a web browser that … Continue reading

Posted in Uncategorized | Tagged , , , , , | 1 Comment

A Quadtree-Based Collision System in JavaScript

The JavaScript code below, when run, will create a playfield full of small circular bodies, each moving in a random direction. When two circles collide, they will bounce off of each other and move in different directions. To see the … Continue reading

Posted in Uncategorized | Tagged , , , , , , | Leave a comment

Simulating a Spiral Galaxy Using JavaScript

The code below generates a random simulated galaxy of stars, and displays both a top view and a side view of that galaxy. The structure could probably use some tweaking, which is especially apparent from the side view. But it’s … Continue reading

Posted in Uncategorized | Tagged , , , | 3 Comments

A Simple Top-Down Space Game in JavaScript

The code given below implements a simple top-down space game in JavaScript. The code is adapted from that given for an even simpler game described in an earlier post. Use the W key to accelerate and the A and D … Continue reading

Posted in Uncategorized | Tagged , , , | 1 Comment

A Simple Turn-Based Game Loop in JavaScript

The JavaScript code below implements a turn-based version of a simple game from a previous post. The goal is to navigate through the “maze”, go through the door, grab the elixir, and return it to the gravestone back at the … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Simulating an Ant Farm in JavaScript

This code isn’t quite done yet, but it does run, and I figured I’d better put it out there on the Internet before it got lost forever the next time something horrible happens to my hard disk. To use the … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Simulating a Simple World in JavaScript

The code listing included below uses concepts from previous posts on this blog (namely, the ones where a primitive orrery and an a-star pathfinding algorithm were implemented) to create a small microcosm in which several agents move from station to … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment