Skip to content

Instantly share code, notes, and snippets.

@fresh5447
Created February 13, 2014 17:07
Show Gist options
  • Save fresh5447/8979283 to your computer and use it in GitHub Desktop.
Save fresh5447/8979283 to your computer and use it in GitHub Desktop.
Methods
Best Method for this argument?
p add(1,2)
p add(4,5)
p add(7,7)
------------------------------------
Why doesn't this work
```def add (a,b)
a + b
c + d
e + e
end
p add(1,2,4,5,7) ```
----------------------------------------------------------
This is also just as unaffective:
```def add (p1,p2,p3)
p1= 1 + 2
p2= 4 + 5
p3= 7 + 7
end
p add("p1")```
-----------------------------------------
This is no good:
def add (x,y)
x+y
end
p add (1,2)
-----------------------------------------
I actually thought this one was going to work
def add(n1, n2, n3, n4, n5)
p1 = n1 + n2
p2 = n3 + n4
p3 = n5 + n5
end
p add(1,2,4,5,7)
---------------------------------------------------
This is my attempt at the website method:
def link (address, text)
<a href= "address"> "text" </>
end
p link(http://google.com,Google)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment