Chipgrid / Documentation / Reference

Symbols

The characters that are not operators but still mean something: the bang, comments and rails.

* bang

A bang: lives one tick and triggers what it touches.

A bang lives for one tick, then disappears. A sound or drawing operator fires when a bang touches it — on its left, above or below. Type one by hand next to a voice while playing: it plays once.

History. This is the trigger. On a console, the CPU poked a few bytes into the sound chip’s registers once per video frame — every note you ever heard on a NES started as one of those writes.

Example

# BANG - example #
.
..D8
...P5E14
.
....B2C4

Open in Chipgrid ↗

D8 writes a bang under itself every 8 ticks, just left of P: it beeps. The B below has no bang next to it, so it stays silent.

Try this

  • While it plays, type * just left of B: it plays once, then the bang disappears.
  • Type the * above or below B instead: it works too. To its right: nothing.

# comment

A comment, up to the next # on the line.

Everything after # on the line (until the next #) is ignored. Use it to label your blocks.

Example

# COMMENT - example #
.
.# kick #.D4
...........B3C2o
.
.# not closed .D4
...............B3G2o

Open in Chipgrid ↗

The first line is a closed comment # kick #: the D4 after it still runs and plays the kick. On the fourth line the comment is not closed, so it runs to the end of the line and swallows its D4: the second B stays silent.

Try this

  • Close the second comment: type # after “closed”. The second kick starts.
  • Name your blocks with comments: it makes a big grid readable.

_ rail

A rail. It does nothing by itself: a mover can travel over it, and it comes back behind the mover. _ and | are the same thing, one for horizontal lines and one for vertical ones. They let you see your tracks, even when nothing is playing: the layout of the code becomes a drawing.

| rail

A rail, for vertical lines. See _.

Esc