TL;DR

Moiré Explorer is an ASCII-play demo script by user ertdfgcvb that generates patterns by indexing a density string with coordinates and frame data. The code uses coord.x and coord.y along with context values like cols and frame to compute which character to output for each cell.

What happened

A small generative-art script titled "Moiré Explorer" was published on the ASCII-play site by author ertdfgcvb. The exported main() function receives coord, context, cursor and buffer objects and returns a single character chosen from a density string. The script extracts cols and frame from context and x,y from coord. It computes a sign based on the parity of y (y % 2 * 2 – 1, yielding -1 or 1) and then computes an index as (cols + y + x * sign + frame) modulo the length of the density string. The chosen character density[index] is returned for each coordinate. The playground UI around the script shows run and editing controls, keyboard shortcuts, example lists and options to save, share or download the script. The entry is listed on the project page and carries the published timestamp provided in the source.

Why it matters

  • Illustrates a compact technique for producing complex ASCII patterns using only coordinate math and a character density ramp.
  • Shows how frame and column values can be combined with per-line sign changes to create alternating, potentially moiré-like effects.
  • Provides a lightweight, editable example in an interactive playground that users can run, save, share or download.
  • Serves as a minimalist reference for developers learning how 2D coordinates map to visual output in grid-based renderers.

Key facts

  • Author: ertdfgcvb.
  • Project: titled 'Moiré Explorer' on the ASCII-play site.
  • The script defines a density string: 'Ñ@#W$9876543210?!abc;:+=-,._ '.
  • main(coord, context, cursor, buffer) is exported and must return a single character or an object with a 'char' field.
  • Context provides cols and frame; coord provides x and y.
  • The code computes sign as y % 2 * 2 – 1, producing -1 for even lines and 1 for odd lines.
  • Index calculation: (cols + y + x * sign + frame) % density.length selects the output character.
  • The UI includes Run, Save, Share, Download script and keyboard shortcuts as shown on the page.
  • Published timestamp in the source: 2026-01-04T12:54:20+00:00.
  • The script is presented among many examples and demos such as Donut, Plasma and Camera renderers.

What to watch next

  • How frame changes affect the visual output over time (the code uses context.frame to influence the index).
  • How the alternating sign based on y parity combines with cols and x to produce interference or moiré-like patterns on different grid sizes.
  • not confirmed in the source: whether the author will add variants or additional controls for density, speed or resolution in future updates.

Quick glossary

  • density: A string of characters used as a palette; each index in the string maps to one character that can be drawn to the grid.
  • coord: An object representing a cell's coordinate in the grid, typically exposing x and y properties.
  • frame: A numeric counter representing the current frame number, often used to animate changes over time.
  • modulo: An arithmetic operation that yields the remainder after division, commonly used to wrap indexes within a fixed range.
  • moiré: A visual interference pattern that can appear when overlaying repeated structures or grids with slight offsets.

Reader FAQ

Who authored Moiré Explorer?
The script author is listed as ertdfgcvb.

How does the script choose which character to draw?
It computes an index from cols, x, y and frame, then returns the character at that position in the density string.

Can I run, save or share the script from the page?
Yes; the page shows Run, Save, Share and Download script options in its UI.

Does the output animate over time?
The code uses a frame value in its index calculation, so running the script can produce changing output across frames.

Is the source code open-source or licensed?
not confirmed in the source

/** @author ertdfgcvb @title Coordinates: x, y @desc Use of coord.x and coord.y */ ​ const density = 'Ñ@#W$9876543210?!abc;:+=-,._ ' ​ export function main(coord, context, cursor, buffer) { // To…

Sources

Related posts

By

Leave a Reply

Your email address will not be published. Required fields are marked *