Create a function named "reverse" for the String prototype that will allow the following functionality:
EXAMPLE:
"String".reverse(); //=> returns "gnirtS"
"I like cookies".reverse(); //=> "seikooc ekil I"
##How many lightsabers do you own?
Inspired by the development team at Vooza, write the function "howManyLightsabersDoYouOwn"" that accepts the name of a programmer, and returns the number of lightsabers owned by that person. The only person who owns lightsabers is Zach, by the way. He owns 18, which is an awesome number of lightsabers. Anyone else owns 0.
howManyLightsabersDoYouOwn("anyone else") \\ should === 0
howManyLightsabersDoYouOwn("Zach") \ should === 18
###Make Google CSS
How much do you love google, doodles? Now you can save them for eva!
Make a HTML docment and CSS file that replicates the google.com home page with your favourite doodle from
You page must 'look' realistic including the search box and buttons.
It's approaching lunch hour… let's collect orders. Create a new file called lunch_orders.rb to complete this exercise.
| require 'minitest/autorun' | |
| require 'minitest/reporters' # optional | |
| Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new() # optional | |
| require_relative './allergies' | |
| class AllergiesTest < MiniTest::Test |
#Install WDI_MELB style
##Stage 1 - Ruby Version Manager
go to rvm.io copy and paste the two commands
command no. 1
#####Magic Balls
magic8ball.jsJS function that randomly returns one of the following strings to the console when called..."No", "Not today", "It is decidedly so",
##Getting Close
You and some friends usually play a gathering game (like a scavenger hunt) using geo-coordinates in a park, but it has gotten so popular that many people want to join in. One of your friends created an API. An API is a way us getting data from a service. for people to add items hidden in the park, but now you want to build an App to help people decide what to find in the park.
You are given the following set of data as a result back from an API request and you want to sort those results in terms of proximity to the user of your site.
var myResults = [ {name: "six pack of beer", location: {lat: 37.767182, long: -122.5}},
{name: "whacky glasses", location: {lat: 37.767182, long: -122.51}},
{name: "whiskey bottle", location: {lat: 37.767282, long: -122.49}},
We're going to balance words on one of the letters in them.
We'll use the position and letter itself to calculate the weight around the balance point. A word can be balanced if the weight on either side of the balance point is equal. Not all words can be balanced, but those that can are interesting for this challenge.
The formula to calculate the weight of the word is to look at the letter position in the English alphabet (so A=1, B=2, C=3 ... Z=26) as the letter weight, then multiply that by the distance from the balance point, so the first letter away is multiplied by 1, the second away by 2, etc.
As an example: