We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f926667 + 70b8974 commit 4692141Copy full SHA for 4692141
1 file changed
ruby/lesson2/tutorial.md
@@ -130,22 +130,6 @@ puts "Total time #{duration} seconds"
130
puts "#{duration/turns} seconds per problem"
131
```
132
133
-### Bonus
134
-
135
-At the beginning of the game ask for the number of turns. If return is pressed default to 0.
136
137
-> To default value of a variable, only if the variable empty you can use the `||=` operant. This is called lazy loading.
138
139
-```ruby
140
-# here the number will get assigned to 1 as its value is nil
141
-number = nil
142
-number ||= 1
143
144
-# The number will not get assigned to 1 because it already has a value
145
-number = 2
146
147
-```
148
149
## Reading and writing to a file
150
151
In Ruby we can use the `File` object to read and write to files.
0 commit comments