Added: 2 years ago
From: supershospy
Views: 1,285
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (8)

Sign In or Sign Up now to post a comment!
  • how long did it take you.

  • hi can u explain how u implement the torus to bypass the boundary check pls? thanks a ton

  • Just imagine 8 copies of the above screen laid around the edges of itself; that is, the left edge is identified with the right edge, the top edge is identified with the bottom edge, the right upper corner is identivied with the lower left corner, etc.

    I tried to post a section of my (C) program here, but the minimum amount necessary (to make any sense) is about 2800 charaters long, which exceeds the allowed comment length.

  • sry but i am nt sure what u mean...

    when i have a cell moving out from left edge, how does the board on the left side of the original board is going to help me move the cell to the right of the original cell with the help of the board at the right?

  • I'm assuming you are asking how to write a program that uses a "torus" universe (instead of one that uses a finite rectangle, with outside pixels turned off).

    A torus ("surface of a doughnut") is obtained by starting with a rectangle, then pasting together the top and bottom edges and the left and right edges.

  • How do we modify the algorithm of the game of life to make it a torus?

    For pixels that are not on the edges or corners, the algorithm for calculating the number of adjacent pixels (that are turned on) is unchanged.

    For pixels on one of the edges, make a mental copy of the entire screen and lay it next to the edge on which the pixel in question lies - then you can count the number of (turned-on) pixels that are in contact with the pixel in question.

  • An analogous strategy applies to corner pixels, but in this case you must place three copies of the screen so that they surround the corner pixel in question.

    I guess a couple of pictures would be more helpful.

  • thx a lot for the tips =D

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more