Sololearns Swift Simulator Stack Spce | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Sololearns Swift Simulator Stack Spce

Hello Everybody, I just wrote my second Swift program in the Code Playgrond. its 'https://code.sololearn.com/cYs4V1NN2Lcx/#swift', fact_fib_numbers. This code uses the recursive definition of Factorial and Fibonacci numbers. fib(n:Int)->Int is a doubly recursive function, but why can't I calulate anything over fib(n:8)????? Have I run out of stack space in the simulator??? If I run the program for the range 0...10, prints 0...8 Fibonacci numbers, then waits a long time and finaly quits. no error message. What's going on???

28th Aug 2018, 7:47 PM
Rick Shiffman
Rick Shiffman - avatar
2 Answers
+ 2
really? it works fine for me, so it may be related to your device or your internet connection
28th Aug 2018, 7:51 PM
hinanawi
hinanawi - avatar
+ 2
I just loaded the new SoloLearn app on my new iPhone. Now I don't have any problems with stack space that I had when I was using the web interface from my laptop. With the app the execution is almost instantaneous.
29th Aug 2018, 12:48 AM
Rick Shiffman
Rick Shiffman - avatar