Monday, 11 July 2016

There's No Way This Works

Difficulty:
Elementary

Tags:
strings

Instructions:
At first you think, "There's no way this will work without curly braces." But after thinking about it for a while, you begin to wonder...

Problem and Solution:

Injected and Rejected

Difficulty:
Elementary

Tags:
arithmetic, enumerables

Instructions:
Write a method using inject and reject that takes an array of integers and gets the sum for all numbers greater than 50

Problem and Solution:

Temperature Robot

Difficulty:
Elementary

Tags:
case statements, ranges, ranges

Instructions:
Temperature bot is comfortable when it's room temperature (18-21C). Help him out by completing the method.

Problem and Solution:

The Curious Case of the Missing Method Part 2

Difficulty:
Elementary

Tags:
enumerables

Instructions:
Fill in the missing method. Hint: find the right six-letter enumerable method: http://ruby-doc.org/core-1.9.3/Enumerable.html. There's also a four-letter alias for the method too.

Problem and Solution:

Blackjack

Difficulty:
Elementary

Tags:
arithmetic, splat operator

Instructions:
Write a method that takes any number of integers and returns true if they sum to 21, false otherwise. Hint: splat operator.

Problem and Solution:

The Curious Case of the Missing Method

Difficulty:
Elementary

Tags:
enumerables, arrays

Instructions:
Stop this code from throwing an exception. Hint: find the right seven-letter array method: http://ruby-doc.org/core-1.9.3/Array.html

Problem and Solution:

FizzBuzz

Difficulty:
Elementary

Tags:
arithmetic, strings

Instructions:
If a number is divisible by 3, return "Fizz". If a number is divisible by 5, return "Buzz". If a number is divisible by 3 and 5, return "FizzBuzz"

Problem and Solution: