Skip to content

Instantly share code, notes, and snippets.

View paaggeli's full-sized avatar

Panos Angel paaggeli

View GitHub Profile
@jordanhudgens
jordanhudgens / gist:8033986
Last active February 4, 2022 09:51
Functional Programming Exercises
### Generate an array of numbers, from 1 to 10:
(1..10).to_a
# => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
### Generate an array of letters from 'a' to 'g':
("a".."g").to_a
# ⇒ ["a", "b", "c", "d", "e", "f", "g"]
### Generate an array of double letters from 'aa' do 'gg':
("a".."g").to_a.map {|i| i * 2}