Skip to content

Feature Request - String/Hex Encoding #1

@Yelf42

Description

@Yelf42

Hi!

Your nonogram maker is easily the best I've seen online, especially for also taking solvability into account.
I'm working on a Minecraft plugin that creates nonograms in game that can already create random nonograms (with either unique or multiple solutions), but it also supports creating nonograms from a hexadecimal representation so that identical nonograms or custom made nonograms can be created.

I've got a very thrown together method right now for getting custom made encodings, but it's cumbersome and not viable long term, so I was wondering if you could add a nonogram-to-hex conversion to your site. My bootleg approach already requires generating a json using your generator so I've already got code that converts it:

function encodeGrid(grid) {
  const height = grid.length;
  const width = grid[0].length;
  let bits = 0n;
  for (let row = 0; row < height; row++) {
    for (let col = 0; col < width; col++) {
      if (grid[row][col] === 1) {
        bits |= (1n << BigInt(row * width + col));
      }
    }
  }
  return bits.toString(16);
}

No worries if not, and thanks for the site!

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