回答編集履歴
1
test
CHANGED
@@ -3,8 +3,7 @@
|
|
3
3
|
```ruby
|
4
4
|
p shiritori_words = ["apple", "et", "tex", "abc", "dc"]
|
5
5
|
|
6
|
-
def shiritori(word
|
6
|
+
def shiritori(word1, word2)
|
7
|
-
word1, word2 = words
|
8
7
|
if word1[-1] != word2[0]
|
9
8
|
puts "#{word1[-1]}と#{word2[0]}が違うよ"
|
10
9
|
return true
|
@@ -13,6 +12,6 @@
|
|
13
12
|
end
|
14
13
|
|
15
14
|
shiritori_words.each_cons(2) do |two_words|
|
16
|
-
break if shiritori(two_words)
|
15
|
+
break if shiritori(*two_words)
|
17
16
|
end
|
18
17
|
```
|