Sierpinski carpet: Difference between revisions
m
→Bash/Ksh/Zsh + dc(1): Use shell parameter substitution instead of `tr` to turn ternary into binary
(→{{header|Commodore BASIC}}: Add implementation.) |
m (→Bash/Ksh/Zsh + dc(1): Use shell parameter substitution instead of `tr` to turn ternary into binary) |
||
Line 6,087:
(( size = 3 ** n ))
for (( y=0; y<size; ++y )); do
y1=$(dc <<<"$y 3op"
for (( x=0; x<size; ++x )); do
x1=$(dc <<<"$x 3op"
if (( 2#${x1//2/0} & 2#${y1//2/0} )); then
printf ' '
else
|