Skip to content

Commit bb6d353

Browse files
committed
adding brief info on what does to_i do with a link to the documentation on the same
1 parent 65b09e3 commit bb6d353

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ruby/lesson2/tutorial.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ In this exercise we want to generate two random numbers x and y using `Random.ra
7979
```ruby
8080
print "#{x} + #{y} = "
8181

82-
answer = gets.chomp().to_i
82+
answer = gets.to_i
8383
```
8484

85+
> [to_i](http://apidock.com/ruby/Symbol/to_i) returns an integer representation of an object.
86+
8587
if the answer is correct, output `Right!`. If the answer is incorrect, output `Wrong :(`.
8688

8789
> Use an _if .. else .._ statement

0 commit comments

Comments
 (0)