Chip, 174 bytes
171 bytes for the code + 3 bytes for the flag (
zvzvzvzvzvzvzvzvzzvzvz-* >/-/-/-/~/-/~/-/--/-/~g >/-/~/-/~/-/~/~/-~/~/a `/~/~/-/~/~/-/-/--/~/c >~/~/~/-/~/-/-/-~/~/~d tz | |~/~/-/-/-/--/~/f >-/-/~/-/~/~/b `~/~/~/e
Chip is a 2D language inspired by integrated circuits, input and output are broken down into individual bits which travel through gates and across wires.
Ungolfed (243 bytes):
tvzvzvzvzvzvzvzvzvzvzvzvz-* -/-/-/-/-/-/-/-/-/-/-/-/-h ~/-/-/-/-/~/-/~/-/-/-/-/~g -/-/-/-/~/~/-/-/-/-/-/~/-f -/-/~/~/~/~/-/-/-/-/-/-/-e -/~/~/~/~/-/~/-/-/-/~/~/~d ~/-/~/~/-/~/~/-/-/-/-/~/-c -/-/~/-/-/~/-/~/~/-/-/-/-b ~/-/-/~/-/~/-/~/~/-/~/~/-a
How the ungolfed version works:
This implementation encodes the target string
Hello, World! as a series of transitions between each character. The leftmost column of
~'s corresponds to
H in the output, the rightmost column to
- is a simple horizontal wire, and
~ is a left-to-right not gate.
The top row is for timing, and the remaining rows are for the bits of the output (the row ending in
h is the highest bit, and
a is the lowest).
The timing row's behavior starts with the
*, which produces an always-on signal. (It is stood off with a horizontal wire to prevent interaction with
h below it). The
z's delay signal propagation right-to-left by one cycle, each one corresponds to the transition to the next letter of the output. The
v's are wires connecting this timing sequence to the columns with
/'s. These columns are switches used to sequence the various character transitions. At the end of the timing row is
t, which terminates the program, preventing infinite exclamation marks at the end.
In the first cycle, only the rightmost column is connected, so bits
g turn on because
on; the remaining bits stay off. This gives us
01001000, which is
In the next cycle, the rightmost two columns are now connected.
f turn on much like the bits in the first cycle, and
d turns off again because
off. This gives us
01100101, which is
This continues all the way across to the left, giving the remainder of the output.
There's not a lot that could be done here, but there are a few things of note:
hrow is always off, so that can be eliminated.
- The double
lin "Hello" eliminates the need for one of the switch columns.
- Each row can be trimmed on both ends, removing unnecessary
-'s, so long as the timing signal can still be propagated downward. This is why the rows are rearranged.
- For the leftmost column, a wire connector
>can be used instead of
~/, as they behave the same in this context. This eliminates the leftmost column, except for the
tcan be moved to the empty space in the lower left from the trimming, so long as it is accompanied by enough
z's to have the same timing as before. This fully eliminates the leftmost column.