Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
5 deleted 409 characters in body
source | link

Chip, 174 166 106106 97 bytes

10394 bytes for the code + 3 bytes for the flag (-w) which allows execution without input.

,!ZZZZZZZZZZZZt
|))))))x)))))f
|)xx)x-))xxxa
|)))))-))x))c
)))))x-))))g
)-))))-x)xd
|z. b--((^e
`{*   b ee^b^e

Try it online!Try it online!

Ungolfed (144134 bytes):

*Z~.
,--'
>ZZZZZZZZZZZZt!ZZZZZZZZZZZZt
xxxxxxxxxxxxxh
)))))xx)))))xg
x))))))x)))))f
xxxxxxx)x)xxxe
)x))))xx)x)xxd
x)))))x))x))xc
xxxx)xx)))xxxb
x)xx)xx))xxx)a

The first three rows arerow is for timing, and the remaining rows are for each of the bits of the output (the row ending in h is the highest bit, and a is the lowest).

The timing behavior starts with the first row. * produces an always-on signal, which is delayed one cycle by the Z!. The output of the Z is inverted by the NOT-gate ~!. The resultant output of this contruct is produces a single 1-cycle pulse at the beginning of execution. Wire elements guide this signal down to the rest of the circuit. The restline of Zs then control the left-to-right propagation of the signal at a rate of one element per cycle, each one corresponding to the transition between consecutive letters of the output. Each Z also sends a signal to the column below. At the end of the timing row is t, which terminates the program, preventing infinite output of null characters at the end.

  • The h row is always off, so that can be eliminated.
  • Each row can be trimmed on both ends, removing unnecessary x's, so long as the timing signal can still be propagated downward to rows that need it below. This is why the rows are rearranged; to maximize the trimming that can occur.
  • The timing initialization portion (first two rows of the ungolfed version) can be moved to the empty space freed up by the aforementioned trimming.
  • The construct )a is equivalent to simply a, so long as the signal did not need to be propagated downward from the OR-gate.

Chip, 174 166 106 bytes

103 bytes for the code + 3 bytes for the flag (-w) which allows execution without input.

,ZZZZZZZZZZZZt
|))))))x)))))f
|)xx)x-))xxxa
|)))))-))x))c
)))))x-))))g
)-))))-x)xd
|z. b--((^e
`{*    e

Try it online!

Ungolfed (144 bytes):

*Z~.
,--'
>ZZZZZZZZZZZZt
xxxxxxxxxxxxxh
)))))xx)))))xg
x))))))x)))))f
xxxxxxx)x)xxxe
)x))))xx)x)xxd
x)))))x))x))xc
xxxx)xx)))xxxb
x)xx)xx))xxx)a

The first three rows are for timing, and the remaining rows are for each of the bits of the output (the row ending in h is the highest bit, and a is the lowest).

The timing behavior starts with the first row. * produces an always-on signal, which is delayed one cycle by the Z. The output of the Z is inverted by the NOT-gate ~. The resultant output of this contruct is a 1-cycle pulse at the beginning of execution. Wire elements guide this signal down to the rest of the circuit. The rest of Zs control the left-to-right propagation of the signal at a rate of one element per cycle, each one corresponding to the transition between consecutive letters of the output. Each Z also sends a signal to the column below. At the end of the timing row is t, which terminates the program, preventing infinite output of null characters at the end.

  • The h row is always off, so that can be eliminated.
  • Each row can be trimmed on both ends, removing unnecessary x's, so long as the timing signal can still be propagated downward to rows that need it below. This is why the rows are rearranged; to maximize the trimming that can occur.
  • The timing initialization portion (first two rows of the ungolfed version) can be moved to the empty space freed up by the aforementioned trimming.
  • The construct )a is equivalent to simply a, so long as the signal did not need to be propagated downward from the OR-gate.

Chip, 174 166 106 97 bytes

94 bytes for the code + 3 bytes for the flag (-w) which allows execution without input.

!ZZZZZZZZZZZZt
|))))))x)))))f
|)xx)x-))xxxa
|)))))-))x))c
)))))x-))))g
)-))))-x)xd
    b e^b^e

Try it online!

Ungolfed (134 bytes):

!ZZZZZZZZZZZZt
xxxxxxxxxxxxxh
)))))xx)))))xg
x))))))x)))))f
xxxxxxx)x)xxxe
)x))))xx)x)xxd
x)))))x))x))xc
xxxx)xx)))xxxb
x)xx)xx))xxx)a

The first row is for timing, and the remaining rows are for each of the bits of the output (the row ending in h is the highest bit, and a is the lowest).

The timing behavior starts with the !. ! produces a single 1-cycle pulse at the beginning of execution. The line of Zs then control the left-to-right propagation of the signal at a rate of one element per cycle, each one corresponding to the transition between consecutive letters of the output. Each Z also sends a signal to the column below. At the end of the timing row is t, which terminates the program, preventing infinite output of null characters at the end.

  • The h row is always off, so that can be eliminated.
  • Each row can be trimmed on both ends, removing unnecessary x's, so long as the timing signal can still be propagated downward to rows that need it below. This is why the rows are rearranged; to maximize the trimming that can occur.
  • The construct )a is equivalent to simply a, so long as the signal did not need to be propagated downward from the OR-gate.
4 added 111 characters in body
source | link

103 bytes for the code + 3 bytes for the flag (-w) which allows execution without input.

103 bytes for the code + 3 bytes for the flag (-w)

103 bytes for the code + 3 bytes for the flag (-w) which allows execution without input.

3 added 111 characters in body
source | link

Chip, 174 166166 106 bytes

163103 bytes for the code + 3 bytes for the flag (-w)

zvzvzvzvzvzvzvzzzvzz*,ZZZZZZZZZZZZt
>/-/-/-/~/-/~/-/-/-/~g|))))))x)))))f
>/-/~/-/~/|)xx)x-/~/~/~/~/a))xxxa
`/~/~/-/~/~/-/-/|)))))-/~/))x))c
 >~/~/~/-/~/-/)))))x-/~/~/~d))))g
tz | |~/~/-/-/)-/))))-/~/fx)xd
  |z. >-/b-/~/-/~/~/b((^e
`{*   `~/~/~/ e

Try it online!Try it online!

Ungolfed (243144 bytes):

tvzvzvzvzvzvzvzvzvzvzvzvz-**Z~.
-/-/-/-/-/-/-/-/-/-/-/,-/-h'
~/-/-/-/-/~/-/~/-/-/-/-/~g>ZZZZZZZZZZZZt
-/-/-/-/~/~/-/-/-/-/-/~/-xxxxxxxxxxxxxh
)))))xx)))))xg
x))))))x)))))f
-/-/~/~/~/~/-/-/-/-/-/-/-exxxxxxx)x)xxxe
-/~/~/~/~/-/~/-/-/-/~/~/~d)x))))xx)x)xxd
~/-/~/~/-/~/~/-/-/-/-/~/-cx)))))x))x))xc
-/-/~/-/-/~/-/~/~/-/-/-/-bxxxx)xx)))xxxb
~/-/-/~/-/~/-/~/~/-/~/~/-x)xx)xx))xxx)a

This implementation encodes the target string Hello, World! as a seriesbit matrix, somewhat reminiscent of transitions between each charactercore memory. The leftmost column of -)'s and ~x's corresponds to H in the output, the rightmost column to !. The -) is an Or-gate (mapping to a simple horizontal wire1 in the output), and the ~x is a left-to-right not gatewire crossing (mapping to a 0).

The top row isfirst three rows are for timing, and the remaining rows are for each of 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 first row. *, which produces an always-on signal, which is delayed one cycle by the Z. The output of the (ItZ is stood off with a horizontal wire to prevent interaction withinverted by the NOT-gate h~ below it). The resultant output of this contruct is a 1-cycle pulse at the beginning of execution. Wire elements guide this signal down to the rest of the circuit. The rest of zZ's delay signal propagation rights control the left-to-left byright propagation of the signal at a rate of one element per cycle, each one correspondscorresponding to the transition to the next letterbetween consecutive letters of the output. The v's are wires connecting this timing sequence to the columns withEach /Z's. These columns are switches used also sends a signal to sequence the various character transitionscolumn below. At the end of the timing row is t, which terminates the program, preventing infinite exclamation marksoutput of null characters at the end.

In the first cycle, only the rightmostfirst data column is connected, so bits d andpowered. We see OR-gates (g) turn) on becausethe rows for bits not(nothing)d isand ong;, turning them on; the remaining bits stay off because the wire crosses (x) won't propagate the signal from the top to the left. This gives us 01001000, which is H.

In the next cycle, only the rightmost two columns are now connectedsecond data column is powered. Rows a, c, and f and g turn on much like the bits in the first cycle, and d turnsthe remaining bits are off again because not(not(nothing)) is off. This gives us 01100101, which is e.

This continues all the way across to the leftright, giving the remainder of the output.

  • The h row is always off, so that can be eliminated.
  • The double l in "Hello" eliminates the need for one set of switch and encoding columns.
  • Each row can be trimmed on both ends, removing unnecessary -x's, so long as the timing signal can still be propagated downward to rows that need it below. This is why the rows are rearrangedrearranged; to maximize the trimming that can occur.
  • For the leftmost column, a wire connectorThe timing initialization portion > can be used instead(first two rows of ~/, as they behave the same in this context. This eliminatesungolfed version) can be moved to the leftmost column, except forempty space freed up by the taforementioned trimming.
  • The construct t)a can be movedis equivalent to the empty space in the lower left from the trimmingsimply a, so long as it is accompanied by enough z's to have the same timing as before. This fully eliminatessignal did not need to be propagated downward from the leftmost columnOR-gate.

All other changes are just mashing things around to save single bytes.

Chip, 174 166 bytes

163 bytes for the code + 3 bytes for the flag (-w)

zvzvzvzvzvzvzvzzzvzz*
>/-/-/-/~/-/~/-/-/-/~g
>/-/~/-/~/-/~/~/~/~/a
`/~/~/-/~/~/-/-/-/~/c
 >~/~/~/-/~/-/-/~/~/~d
tz | |~/~/-/-/-/-/~/f
   >-/-/~/-/~/~/b
   `~/~/~/e

Try it online!

Ungolfed (243 bytes):

tvzvzvzvzvzvzvzvzvzvzvzvz-*
-/-/-/-/-/-/-/-/-/-/-/-/-h
~/-/-/-/-/~/-/~/-/-/-/-/~g
-/-/-/-/~/~/-/-/-/-/-/~/-f
-/-/~/~/~/~/-/-/-/-/-/-/-e
-/~/~/~/~/-/~/-/-/-/~/~/~d
~/-/~/~/-/~/~/-/-/-/-/~/-c
-/-/~/-/-/~/-/~/~/-/-/-/-b
~/-/-/~/-/~/-/~/~/-/~/~/-a

This implementation encodes the target string Hello, World! as a series of transitions between each character. The leftmost column of -'s and ~'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 d and g turn on because not(nothing) is on; the remaining bits stay off. This gives us 01001000, which is H.

In the next cycle, the rightmost two columns are now connected. a, c, and f turn on much like the bits in the first cycle, and d turns off again because not(not(nothing)) is off. This gives us 01100101, which is e.

This continues all the way across to the left, giving the remainder of the output.

  • The h row is always off, so that can be eliminated.
  • The double l in "Hello" eliminates the need for one set of switch and encoding 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 t.
  • The t can 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.

Chip, 174 166 106 bytes

103 bytes for the code + 3 bytes for the flag (-w)

,ZZZZZZZZZZZZt
|))))))x)))))f
|)xx)x-))xxxa
|)))))-))x))c
)))))x-))))g
)-))))-x)xd
|z. b--((^e
`{*    e

Try it online!

Ungolfed (144 bytes):

*Z~.
,--'
>ZZZZZZZZZZZZt
xxxxxxxxxxxxxh
)))))xx)))))xg
x))))))x)))))f
xxxxxxx)x)xxxe
)x))))xx)x)xxd
x)))))x))x))xc
xxxx)xx)))xxxb
x)xx)xx))xxx)a

This implementation encodes the target string Hello, World! as a bit matrix, somewhat reminiscent of core memory. The leftmost column of )'s and x's corresponds to H in the output, the rightmost column to !. The ) is an Or-gate (mapping to a 1 in the output), and the x is a wire crossing (mapping to a 0).

The first three rows are for timing, and the remaining rows are for each of the bits of the output (the row ending in h is the highest bit, and a is the lowest).

The timing behavior starts with the first row. * produces an always-on signal, which is delayed one cycle by the Z. The output of the Z is inverted by the NOT-gate ~. The resultant output of this contruct is a 1-cycle pulse at the beginning of execution. Wire elements guide this signal down to the rest of the circuit. The rest of Zs control the left-to-right propagation of the signal at a rate of one element per cycle, each one corresponding to the transition between consecutive letters of the output. Each Z also sends a signal to the column below. At the end of the timing row is t, which terminates the program, preventing infinite output of null characters at the end.

In the first cycle, the first data column is powered. We see OR-gates ()) on the rows for bits d and g, turning them on; the remaining bits stay off because the wire crosses (x) won't propagate the signal from the top to the left. This gives us 01001000, which is H.

In the next cycle, only the second data column is powered. Rows a, c, f and g turn on much like the bits in the first cycle, and the remaining bits are off. This gives us 01100101, which is e.

This continues all the way across to the right, giving the remainder of the output.

  • The h row is always off, so that can be eliminated.
  • Each row can be trimmed on both ends, removing unnecessary x's, so long as the timing signal can still be propagated downward to rows that need it below. This is why the rows are rearranged; to maximize the trimming that can occur.
  • The timing initialization portion (first two rows of the ungolfed version) can be moved to the empty space freed up by the aforementioned trimming.
  • The construct )a is equivalent to simply a, so long as the signal did not need to be propagated downward from the OR-gate.

All other changes are just mashing things around to save single bytes.

2 Saved 8 bytes
source | link
1
source | link