Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def repeat(arg1="foo", num=0)
- if (num == 0) && (arg1 == "foo")
- puts "Please give more than one argument"
- elsif num == 0
- return ((arg1 +" ")*2)
- else num > 0 && (num.integer? == true)
- return ((arg1 +" ") * num)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment