Author Archives: thiscouldbebetter

A Brick-Breaking Game in JavaScript

Below is a simple brick-breaking game implemented in JavaScript. Its gameplay is similar to the classic games Breakout and Arkanoid. 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 , , | Leave a comment

An Asteroids Clone in JavaScript

Below is a simple clone of the classic video game Asteroids implemented in JavaScript. To see it in action, copy it into an .html file and open that file in a web browser that runs JavaScript.

Posted in Uncategorized | Tagged , , | Leave a comment

An Artillery Game in JavaScript

Below is a simple artillery game implemented in JavaScript. To see it in action, copy it into an .html file and open that file in a web browser that runs JavaScript. UPDATE 2017/11/22 – I have updated this code to … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

A Retirement Savings Calculator in JavaScript

The JavaScript program below, when run, allows a user to calculate how many years it will take to save enough to replace their salary based on the specified initial savings, savings per year, and rates of return before and after … Continue reading

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

An Adding Machine in JavaScript

The JavaScript code below implements a simple adding machine. To see it in action, copy it into a .html file and open that file in a web browser that runs JavaScript. Or, for an online version, visit https://thiscouldbebetter.neocities.org/addingmachine.html.

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

A Simple Data Transcoder in JavaScript

The JavaScript program below converts data encoded in UTF8, Base64, or hexadecimal format into one of the other encodings. To see the code in action, copy it into a .html file and open that file in a text encoder that … Continue reading

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