I'm getting into functional programming, here is m...
# codereview
l
I'm getting into functional programming, here is my implementation of conways game of life. I feel like the content of main() doesnt really fit the functional paradigm, but i can't figure out a better way that doesn't risk stack overflow (unless I use stuff like tailrec which feels like cheating). I tried looking at other peoples implementations online, but they all seem ridiculously complicated. any advice ?
e
Copy code
generateSequence(initialUniverse) { it.computeNextGeneration() }
    .onEachIndexed { i, _ ->
        if (i != 0) usleep(200_000)
    }
    .forEach { universe ->
        universe.print()
    }
l
thanks!