Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
1
Task/Generic-swap/Ruby/generic-swap-1.rb
Normal file
1
Task/Generic-swap/Ruby/generic-swap-1.rb
Normal file
|
|
@ -0,0 +1 @@
|
|||
a, b = b, a
|
||||
3
Task/Generic-swap/Ruby/generic-swap-2.rb
Normal file
3
Task/Generic-swap/Ruby/generic-swap-2.rb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
def swap(a, b)
|
||||
return b, a
|
||||
end
|
||||
5
Task/Generic-swap/Ruby/generic-swap-3.rb
Normal file
5
Task/Generic-swap/Ruby/generic-swap-3.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
x = 42
|
||||
y = "string"
|
||||
x, y = swap x, y
|
||||
puts x # prints string
|
||||
puts y # prints 42
|
||||
Loading…
Add table
Add a link
Reference in a new issue