JavaScript Projects

I recently began work in JavaScript after quickly learning to use HTML. I have found that JavaScript is an amazing language to learn, simply because of its cross platform support, and because of how easy it is to write and test a program.

The JavaScript programs listed below are listed in the order that I wrote them. I used these programs as a means of learning JavaScript, starting with basic programs to learn syntax, and moving onto more complicated programs to learn how to write all forms of web programs.


Hangman (3/14/2012)

Try JavaScript Hangman!
Picture of Hangman
What is it?

Hangman is a simple 1 player game of hangman verses a computer. The user chooses a number of letters for the word to have, and a number of guesses. The computer then random chooses a word, from a list of over 127,000 words. The user is then given the number of incorrect guesses they chose, to guess the word.

History

Hangman was the first program I ever wrote in both C# and JavaScript. When I wrote it, I had however recently written Project Hangman in VB.NET, so I understood the simple logic I would need to make it work. The problems that I encountered with both programs was the syntax. At the time, I was very used to writing programs in VB.NET which is very different from both C# and JavaScript. To view the C# version of this program visit the C# Hangman page.


Birthday Paradox (3/17/2012)

Try BirthdayParadox!
Picture of Birthday Paradox
What is it?

The birthday paradox is a probability problem about the number of people needed before there is a greater than 50% chance that 2 people will share the same birthday. More information can be found on the Birthday Paradox problem on the Wikipedia Birthday Paradox page.

History

I started working on this problem shortly after writing project hangman in both JavaScript and C#. I wrote the program so I could get a feel both for solving problems with programing languages, something I had never done, and to get a feel for how hash-maps work in different languages. To view the JavaScript version of this program visit the C# Birthday Paradox page.


Evil Hangman (3/22/2012)

Try Evil Hangman!
Picture of Evil Hangman
What is it?

Evil Hangman is a malicious form of the classic game of hangman. In evil hangman, users choose a word length and a number of guesses. However, unlike in hangman, the computer does not choose a word. Instead, the computer maintains a list of words. When the user chooses a letter, the computer refines its list, so that as many words as possible remain in the list of words, and the user either gets no information back, or very little. It is very difficult to beat the computer in a game of Evil Hangman. The strategy of Evil Hangman is very different, instead of guesses common letters, looking for word patters, you must guess letters so that the computer will eliminate words that contains those letters from its word list. More information can be found on Evil Hangman at the official Evil Hangman website.

History

I wrote Evil Hangman immediately after writing the Birthday Paradox in both C# and JavaScript. Evil Hangman is an amazing introduction into the use of hash tables in programming. Unlike my previous version of Evil Hangman, in my VB.NET Project Hangman this version works well. Because of the dictionary, sorting the words into different groups is easy, and this program is bug free.