Skip to content

Commit d99a26b

Browse files
committed
to merge Conflicts: week2/homework/questions.txt week2/homework/simon_says_spec.rb
2 parents 2b6079f + 500e6f9 commit d99a26b

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

week2/homework/questions.txt

+4
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ A module is a collection of constants and methods. Enumerable has methods used f
1717
A class can only inherit from one parent class, but by using Mixin Modules you can simulate multiple inheritance.
1818

1919
5. What is the difference between a Module and a Class?
20+
<<<<<<< HEAD
2021
Modules you can use across multiple classes. Modules are about functions and constants and classes are about objects and instances.
22+
=======
23+
Modules you can use across multiple classes. Modules are about functions and constants and classes are about objects and instances.
24+
>>>>>>> 500e6f9d77bbce46d757bf3757289e7e5b1b69ae

week2/homework/simon_says.rb

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
class SimonSays
2+
def echo answer
3+
puts answer
4+
end
5+
def shout phrase
6+
puts phrase.upcase
7+
end
8+
def repeat (text, num)
9+
if num == nil
10+
num = 1
11+
num.times do
12+
puts text
13+
end
14+
else
15+
num.times do
16+
puts text
17+
end
18+
end
19+
end
20+
def start_of_word(text, num)
21+
index = num - 1
22+
puts text[0..index]
23+
24+
end
25+
def first_word(text)
26+
puts text.split(' ').first
27+
end
28+
end

0 commit comments

Comments
 (0)