Skip to content

Test for complete or incomplete generation #107

Description

@Gouvernathor

First observation : there is (minor) code duplication between the two models when it comes to the saving process, in the if that is used to switch between handling a complete or incomplete generation. The old JS port did move that boolean to the Model class.

Second observation, that condition seems wrong.
In Model, the observed array is initialized to -1 everywhere, and then for each cell, if the wave says so, the -1 is replaced with a positive-or-0 value. So, to know if the generation is complete is to know whether at least one boolean in the wave array is false, or equivalently to know whether any value in observed is -1.
But the check that is being made in both models, is to test only the first value of observed for being -1. How can that be correct ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions