Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Generic-swap/RLaB/generic-swap.rlab
Normal file
22
Task/Generic-swap/RLaB/generic-swap.rlab
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
swap = function(x,y)
|
||||
{
|
||||
if (!exist($$.[x]))
|
||||
{ return 0; }
|
||||
if (!exist($$.[y]))
|
||||
{ return 0; }
|
||||
local (t);
|
||||
t = $$.[x];
|
||||
$$.[x] = $$.[y];
|
||||
$$.[y] = t;
|
||||
return 1;
|
||||
};
|
||||
|
||||
>> a=1
|
||||
1
|
||||
>> b = "fish"
|
||||
fish
|
||||
>> swap( "a" , "b" );
|
||||
>> a
|
||||
fish
|
||||
>> b
|
||||
1
|
||||
Loading…
Add table
Add a link
Reference in a new issue