Michael Obeng

WEB DEVELOPER


A freelance Web Developer based in London. My primary focus is in algorithm design using web development technologies such as Javascript and PHP. My current goal is to find an open source project or software company I can make a meaningful contribution to.

Code Snippets


Caesars Cipher

One of the simplest and most widely known ciphers is a Caesar cipher. In a Caesar cipher the meanings of the letters are shifted by some set amount. A common modern use is the ROT13 cipher, where the values of the letters are shifted by 13 places. This Javascript function takes a ROT13 encoded string as input and returns a decoded string.

function rot13(str) { 
  
  var newArray = [];
  
  for (var i = 0; i < str.length; i++) {
    if (str.charCodeAt(i) < 65 || str.charCodeAt(i) > 90) {
      newArray.push(str.charAt(i));
    } else if (str.charCodeAt(i) > 77) {
      newArray.push(String.fromCharCode(str.charCodeAt(i) - 13));
    } else {
      newArray.push(String.fromCharCode(str.charCodeAt(i) + 13));
    }    
  }  
  return newArray.join("");
}


rot13("UVER ZR!");

print "How many items do you want to see? "

number_of_iterations = gets.chomp.to_i

number_of_iterations.times do |item|
  remove_zero_index = item + 1
  if (remove_zero_index % 3 == 0) && (remove_zero_index % 5 == 0)
    puts "Foobar"
  elsif remove_zero_index % 5 == 0
    puts "Bar"
  elsif remove_zero_index % 3 == 0
    puts "Foo"
  else
    puts "#{remove_zero_index}"
  end
end

Foobar

This Ruby program is an adaptation of a classic technical interview problem which displays sequences of the Foobar pattern.


Pig Dice Game

This Java program is a player versus computer version of a simple dice game commonly used by mathematics teachers to teach probability concepts.

import java.util.Scanner;

public class PigDice {
	public static void main(String[] args) {
		Scanner keyboard = new Scanner(System.in);		
		int roll, ptot, ctot, turnTotal;
		String choice = "";
		ptot = 0;
		ctot = 0;

		do {
			turnTotal = 0;
			System.out.println("You have "+ptot+" points");

			do {
				roll = 1 + (int)(Math.random()*6);
				System.out.println("\tYou rolled a "+roll+".");
				if (roll == 1) {
					System.out.println("\tThat ends your turn. ");
					turnTotal = 0;
				}
				else {
					turnTotal += roll;
					System.out.print("\tYou have "+turnTotal);
					System.out.print(" points so far this round.\n");
					System.out.print("\tWould you like to \"roll\" again");
					System.out.print(" or \"hold\"? ");
					choice = keyboard.next();
				}
			}while (roll != 1 && choice.equals("roll"));
			
			ptot += turnTotal;
			System.out.println("\tYou end the round with "+ptot+" points.");
			
			if (ptot < 100) {
				turnTotal = 0;
				System.out.println("Computer has "+ctot+" points.");

				do {
					roll = 1 + (int)(Math.random()*6);
					System.out.println("\tComputer rolled a "+roll+".");
					if (roll == 1) {
						System.out.println("\tThat ends its turn. ");
						turnTotal = 0;
					}
					else {
						turnTotal += roll;
						System.out.print("\tComputer has "+turnTotal);
						System.out.print(" points so far this round.\n");
						if (turnTotal < 20) {
							System.out.println("\tComputer will roll again.");
						}
					}
			} while (roll != 1 && (turnTotal < 20 && ctot + turnTotal <= 100));
			
			ctot += turnTotal;
			System.out.print("\tComputer ends the round with ");
			System.out.print(ctot+" points.\n");		
		}

	} while (ptot < 100 && ctot < 100);

	if (ptot > ctot) {
		System.out.println("Humanity wins!!");
	}
	else {
		System.out.println("The computer wins.");
		}
	}
}

Web Apps


Kervan.co.uk

Kervan Sofrasi is my local turkish restaurant. They serve excellent food and their service is second to none. I love this establishment so much I decided to give their website an overhaul. You can click here to view their current website in comparison to the design I came up with.


Weather App

A weather app that displays a 3 day forecast for your current location. A different icon and background image appears depending on the weather (e.g. snowy mountain, hot desert). The user can also toggle between Celsius and Fahrenheit by clicking on the temperature. This app was built using HTML, CSS, Flexbox and jQuery to make API calls to openweathermap.


rightmove.com

A concept design for rightmove.com. That's pretty much it. I decided to create a new webpage for the property listing company. This is a simple page built in HTML and CSS, however I will gradually be adding functionality to it using react.js.


Quote Generator

A random philosophical quote generator created as part of FreeCodeCamp's Front-End Web Development Certification. The user can click a button to show a new random quote and press another button to tweet out a quote. Made using Javascript, HTML and CSS.


Wiki App

A Wikipedia viewer app built as part of FreeCodeCamp's Front-End Web Development Certification. The user can click a button to see a random wikipedia entry, search Wikipedia entries in a search box and see the resulting Wikipedia entries.


Skills & Tools


I have developed proficiency and expertise in the following programming languages and comfort with the following tools.


Contact


Currently looking for new opportunities. Please get in touch via email:

michaelldninc@gmail.com

Google+ GitHub LinkedIn Facebook