Monthly Archives: April 2014

A Tetris Clone in JavaScript

The JavaScript code below implements a simple clone of Tetris in JavaScript. To see it in action, copy it into an .html file and open that file in a web browser that runs JavaScript. Or you can play an online … Continue reading

Posted in Uncategorized | Tagged , , | 1 Comment

Hashing with the SHA-256 Algorithm in JavaScript

The JavaScript code below displays a short message, hashes it with the SHA256 hash algorithm, and displays the result. To see it in action, copy it into an .html file and open that file in a web browser that runs … Continue reading

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

Extracting the Contents of a TAR File in JavaScript

The JavaScript code given below, when run, prompts the user to select a TAR file, displays its contents, and allows the user to download its component files if desired. To see the code in action, copy it into an .html … Continue reading

Posted in Uncategorized | Tagged , , , , , | 5 Comments

A Feistel Network Encryption Algorithm in JavaScript

The JavaScript code below implements a Feistel network algorithm, and uses it to encrypt and decrypt some data using a randomly generated key. To see the code in action, copy it into an .html file, and open that file in … Continue reading

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

Compressing Data with the LZ77 Algorithm in JavaScript

The JavaScript code below, when run, uses the LZ77 algorithm to compress and decompress some demo data, and displays the results on screen. The LZ77 algorithm was first described, as the name somewhat implies, in the year 1977 by the … Continue reading

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

Efficient Searching with AVL Trees

The JavaScript code below implements demonstrates an AVL tree, which is a kind of self-balancing binary search tree. The program creates a new tree, inserts a bunch of values into it, displays the tree, then deletes half of the values … Continue reading

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

Compressing Data with the LZW Algorithm in JavaScript

The code below, when run, displays an interface that can be used to compress and decompress text with the LZW algorithm. To see it in action, copy it into an .html file and open that file in a web browser … Continue reading

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

A 3D Maze Game in JavaScript

The code below implements a simple 3D maze game in JavaScript. To see it in action, copy it into an .html file and open that file in a web browser that runs JavaScript. Or, to play an online version, visit … Continue reading

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

A Simple Ray Tracer in JavaScript

The code below implements a toy ray tracer in JavaScript. To see it in action, copy it into an .html file and open that file in a web browser that runs JavaScript.   Or, for an online version, visit http://thiscouldbebetter.neocities.org/raytracer.html. … Continue reading

Posted in Uncategorized | Tagged , , , | 3 Comments