Commit 7871e566 by Đường Sỹ Hoàng

Names,Variables,Codes,Functions

parent b3f0ef5d
Pipeline #113 canceled with stages
in 0 seconds
# this one is like tour scripts with ARGV
def print_two(*args)
arg1, arg2 = args
puts "arg1: #{arg1}, arg2: #{arg2}"
end
#ok, that *args is actually pointless, we can just do this
def print_two_again(arg1,arg2)
puts "arg1: #{arg1}, arg2: #{arg2}"
end
# this just takes one argument
def print_one(arg1)
puts "arg1: #{arg1}"
end
# this one takes no arguments
def print_none()
puts "I got nothin'."
end
print_two("Zed","Shaw")
print_two_again("Zed","Shaw")
print_one("First!")
print_none()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment