lol. But any idea on how to implement a recursive function to count the number of elements in a list.
Pretty pointless because we can just call the length property but still would like to know how without using that property lol.
Some not too good choices was trying to use exceptions (ArrayIndexOutOfBounds) for the control flow, like incrementing an index then feeding it back into the function until the exception occurs just to return a counter.
Once again pretty useless, but fun nonetheless. Any ideas lol?
Just to say, I found a way to make it work. Really really sloppy and goes along the way of anti designs but yeah. Funny nonetheless lol
Обсуждают сегодня