+ 1
Logic nesting in ruby
what are the rules for nesting logic within logic in ruby? Can you nest an if/else inside an if/else or an if/else inside a while inside a case inside an unless? How many times over can it be done?
3 Antworten
+ 1
You can nest any logic, conditionals, loops inside any logic, conditionals or loops. There are no limits. You can use them as many times as you need. Just make sure you don't create an infinite loop.
+ 1
Thank you. I've discovered that for the most part. I've learned setting global variables is neccasary for sharing variables between loops and conditionals.
Also I was trying to write a program without setting up methods or objects but they really do make things more smooth and simple.
0
Good luck @Ryan Liston.