Skip to content
Snippets Groups Projects
Commit bf7126a4 authored by Ariel Allen-Trosky's avatar Ariel Allen-Trosky
Browse files

Asks user for input and outputs a sorted array

parent fb860a43
Branches main
No related tags found
No related merge requests found
require './lib/sorting_array.rb'
the_array = Arraysorter.new
numbers = []
puts "Welcome to the NUMBERDOME"
puts "Gimmie that number!"
userinput = gets.chomp
numbers << userinput
puts "Cool, thanks!"
anothanumba = true
while anothanumba == true
puts "Anotha numba? Yes/No"
continue = gets.chomp
if continue == "Yes"
puts "What's that number??"
userinput = gets.chomp
numbers << userinput
puts "You gave me #{userinput}!"
else continue == "No"
anothanumba = false
end
end
answer = the_array.sorting numbers
puts "Niiiiice numbers. Here they are sorted! #{answer}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment