Skip to content

The number of blocks in an avatar is sometimes wrong #3

@innix

Description

@innix

Sometimes the generated avatars will have extra or missing blocks in them (e.g. 6 blocks when you asked for 5, or 5 blocks when you asked for 6).

Block placement is RNG so reproducing may take several runs. Run this a few times and eventually you will get an image with more or less than than 6 blocks:

$ python3 example.py 420 6 avatar_6_blocks.png

It is not isolated to even numbers, using an odd number 5 and the same issue will be seen:

$ python3 example.py 420 5 avatar_5_blocks.png

The problem is caused by how the generator creates vertically symmetrical images and dealing with "central" blocks that don't need an opposing block to ensure symmetry. The generator needs to be smarter about where to place blocks to ensure the avatar has the correct number of blocks but still maintains the vertical symmetry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions