Word Waterfall

This is probably my most visually appealing code example, and one of the toughest to write. I was quite pleased to my solution, using an if/else statement and multiple for loops. Using the js console for this is somwhat overkill, but it was an interesting problem.

Multiplying Fractions

This was a problem to multiply two fractions together before then reducing the fractions to their lowest terms. For those who do not remember, you multiply the top number of the fraction by the opposing bottom number. Then you multiply the two bottom numbers. The program then uses to modulo function to see if any number divides into both the top and bottom number. If any do, it then divides both numbers with it.

Word Mangler

This was an exercide to rearrange the letters in a word, whilst keeping the words in the same order. This uses two for loops to grab each word, and then each letter. A letter is chosen at random and added to a fresh variable. That letter is removed from the previous variable, and the search for a new letter begins.

Drawing a Chessboard

Two for loops again. The first determines whether or not the row needs to begin with a space or not. The second draws the '#' and spaces regardless.

Palindrome Checker

For this I had to learn a little Regex to remove any spaces or grammar from the supplied phrase, as well as make it all lower case. The for loop then goes through the word backwards and adding each letter to another variable. If the two variables are the same, the program will give 'True.'

Pyramids

Just a simple little problem to create a pyramid of a determined height.

Fizzbuzz

The classic. If a number is divisible by three, write 'Fizz'. If it's divisible by 5, write Buzz. If it's divisible by 3 and 5, write both.

Go Back Home