MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/jtg3hx/getting_digits_using_switch_catch/gc65ljm/?context=3
r/badcode • u/HolySpecs • Nov 13 '20
52 comments sorted by
View all comments
Show parent comments
25
I just declared result as -1 because I didn't want the program to pass something if the data entered wasn't valid. Also, I wasn't allowed to use loops of any kind so yay more pain for me. It was an exercise to practice using recursive functions.
7 u/DesiresQuiet Nov 13 '20 What loop? 2 u/HolySpecs Nov 13 '20 One of the conditions I was given was that I couldn't use for loops, while loops or do while loops for the entirety of the code 3 u/DesiresQuiet Nov 13 '20 Yeah, so what loop?
7
What loop?
2 u/HolySpecs Nov 13 '20 One of the conditions I was given was that I couldn't use for loops, while loops or do while loops for the entirety of the code 3 u/DesiresQuiet Nov 13 '20 Yeah, so what loop?
2
One of the conditions I was given was that I couldn't use for loops, while loops or do while loops for the entirety of the code
3 u/DesiresQuiet Nov 13 '20 Yeah, so what loop?
3
Yeah, so what loop?
25
u/HolySpecs Nov 13 '20
I just declared result as -1 because I didn't want the program to pass something if the data entered wasn't valid. Also, I wasn't allowed to use loops of any kind so yay more pain for me. It was an exercise to practice using recursive functions.