Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
7
Task/Topic-variable/Ruby/topic-variable-1.rb
Normal file
7
Task/Topic-variable/Ruby/topic-variable-1.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
while DATA.gets # assigns to $_ (local scope)
|
||||
print # If no arguments are given, prints $_
|
||||
end
|
||||
__END__
|
||||
This is line one
|
||||
This is line two
|
||||
This is line three
|
||||
4
Task/Topic-variable/Ruby/topic-variable-2.rb
Normal file
4
Task/Topic-variable/Ruby/topic-variable-2.rb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
DATA.gets
|
||||
p [$_.to_i ** 2, Math.sqrt($_.to_i)] #=> [9, 1.7320508075688772]
|
||||
__END__
|
||||
3
|
||||
Loading…
Add table
Add a link
Reference in a new issue