回答編集履歴
1
Fix typo
answer
CHANGED
@@ -4,10 +4,10 @@
|
|
4
4
|
def hoge(n)
|
5
5
|
ret = ''
|
6
6
|
unless n == 3
|
7
|
-
ret.
|
7
|
+
ret.concat "hello"
|
8
8
|
end
|
9
9
|
if n == 5
|
10
|
-
ret.
|
10
|
+
ret.concat "world"
|
11
11
|
end
|
12
12
|
ret
|
13
13
|
end
|
@@ -17,6 +17,7 @@
|
|
17
17
|
str.concat hoge(5)
|
18
18
|
|
19
19
|
puts str
|
20
|
+
=> hellohelloworld
|
20
21
|
```
|
21
22
|
こちらに実際に動くコードをおいていおきます。(ページ上部のRunボタンをクリックすると動きます)
|
22
23
|
[Ruby code](https://repl.it/repls/CalmMisguidedMemoryallocator)
|