Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

...did you read the actual article? It's explicitly about how instead of stepping the simulation by a time delta you can instead use "animation"-style where you take the time point and derive state straight from it, without any differential calculus:

   def ball_position(time):
      if time < 0:
          return (0, 0)

      stop_time = 2 * Y_VELOCITY / GRAVITY
      if time > stop_time:
          return (X_VELOCITY * stop_time, 0)

      x = X_VELOCITY * time
      y = (Y_VELOCITY - GRAVITY * time / 2) * time
      return (x, y)


Can you do it for the game of life? Pretty please?


I am pretty certain there is no general closed-form solution for Game of Life because it's Turing-complete; although for some initial configurations (gliders etc.) you can have a simple (or not so simple) expression, in the general case you simply have to simulate it step by step, no other way around it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: