Skip to content
Open

Done #12

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions lib/square_array.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
def square_array(array)
# your code here
end
squared_array = []
i = 0
while i < array.size do
squared_array<<array[i]**2
i+=1
end
squared_array
end





# def square_array(array)
# i = 0
# squared_array = []
# while i < array.size do
#
# i+=1
# end
# squared_array(numbers)
# end



#def square_array(array)
# numbers = [1,2,3]
# squared_array = []
# i = 0
# while i < 0 do
# squared_array<<i**numbers
# i+=1
# end

# counter = 0
# pets = ["Dog", "Cat", "Fish", "Bird", "Hamster"]
#
# while pets[counter] do
# puts pets[counter]
# counter += 1
# end