I have an array (a nested array to be more precise), like this:
[["Armando", "P"], ["Dave", "S"], ["Richard", "R"], ["Michael", "S"],
["Allen", "S"], ["Omer", "P"], ["David E.", "R"], ["Richard X.", "P"]]
I want to pass two tuples at a time as the parameters to another function, like:
rps_result(["Armando", "P"], ["Dave", "S"])
rps_result(["Richard", "R"], ["Michael", "S"])
I am trying do this as I loop through my array:
arr.each_slice(2) do |first, second|
rps_game_winner([first, second])
end
However, this does not give the desired answer when I print them the values of the arguments. What am I doing wrong here?
Just remove square brackets over arguments: