我无法让这个程序正确响应用户输入.各种循环技术,或者只运行一次块或无限无论运行块用户输入(我试过什么case和while也).这是我尝试过的最新方法:
work_summary = []
begin
# code that runs a sprint and adds results to the work_summary array
puts "Would you like to add a sprint, Y/N?"
sprint = gets.to_s
end until sprint == "N"
print work_summary, "\n"
Run Code Online (Sandbox Code Playgroud)
Ruby永远不会使用任何各种方法反对我的语法,但它也永远不会有效.