Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System Crash with infity loop. #734

Open
LukasOchmann opened this issue Feb 28, 2020 · 0 comments
Open

System Crash with infity loop. #734

LukasOchmann opened this issue Feb 28, 2020 · 0 comments

Comments

@LukasOchmann
Copy link

On the page "/scala_tutorial/functional_loops", the last Exercise chrashes the system when programed as an Infinity loop.
I did this for fun:

def factorial(n: Int): Int =
  if (n == 4) 24 
  else factorial(n - 1) * n

factorial(3) shouldBe 6
factorial(4) shouldBe 24

3 will never be 4 so it ends in an Infinty loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant