Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Done #1086

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Done #1086

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
56 changes: 55 additions & 1 deletion deli_counter.rb
Original file line number Diff line number Diff line change
@@ -1 +1,55 @@
# Write your code here.
# Write your code here.

# katz_deli = [Logan, Avi, Spencer]

def line (katz_deli)

if katz_deli.length > 0

index = 0
counter = 1
empty_array = []

while index < katz_deli.length

empty_array.push(" #{counter}. #{katz_deli[index]}")

counter += 1
index += 1

end


puts "The line is currently:#{empty_array.join("")}"


else

puts "The line is currently empty."

end
end


def take_a_number (katz_deli, caboose_name)

katz_deli << caboose_name

puts "Welcome, #{caboose_name}. You are number #{katz_deli.length} in line."

end

def now_serving (katz_deli)

if katz_deli.length == 0

puts "There is nobody waiting to be served!"

else

puts "Currently serving #{katz_deli[0]}."
katz_deli.shift

end

end