Skip to content

Instantly share code, notes, and snippets.

/slice Secret

Created February 22, 2013 17:14
Show Gist options
  • Save anonymous/feaae759d0b0cfd65587 to your computer and use it in GitHub Desktop.
Save anonymous/feaae759d0b0cfd65587 to your computer and use it in GitHub Desktop.
def bar(pf, s, vect);
if vect.length == 1;
return pf(vect[0], s);
else
return pf (pf(vect[0], s)[vect.slice(1,len))];
end
end
error is
sort.rb:7: syntax error, unexpected ')', expecting ']'
return pf (pf(vect[0], s)[vect.slice(1,len))];
pf = 2
s = 5
vect = 4
bar = [pf, s, vect];
if vect.length == 1;
return pf(vect[0], s);
else
return pf (pf(vect[0], s)[vect.slice(1,len))];
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment