Jak Ruby Problems and Solutions
You can find popular problems and it's ruby solutions here.
Showing posts with label
rand
.
Show all posts
Showing posts with label
rand
.
Show all posts
Tuesday, 12 July 2016
Random Boolean
Difficulty:
Easy
Tags:
rand, booleans
Instructions:
Return random booleans
Problem and Solution:
Method Acting
Difficulty:
Easy
Tags:
methods, metaprogramming
Instructions:
Write code that will return the name of a method.
Problem and Solution:
Picking Lottery Numbers
Difficulty:
Easy
Tags:
arrays
Instructions:
Return a sample of five random numbers from an array. They should be unique week to week.
Problem and Solution:
Generating Random Numbers
Difficulty:
Easy
Tags:
rand
Instructions:
Supply the needed argument to #rand to generate a random number between 100 and 500. Hint: use Ruby 1.9.3 and ranges.
Hidden Code:
There is hidden code with assertions that is also being run to test out your code.
Problem and Solution:
Older Posts
Home
Subscribe to:
Posts (Atom)