This challenge is a cut'n paste from Enlarge ASCII art, but reversed, using PetSCII based half-block chars:
string=" ▝▘▀▗▐▚▜▖▞▌▛▄▟▙█"
There, PetSCII is emulated by using UTF-8 characters, you may found between U+2580 UPPER HALF BLOCK
and U+259F QUADRANT UPPER RIGHT AND LOWER LEFT AND LOWER RIGHT
.
So the goal is to reduce by 1/2
submited ascii-art.
You have to group 2 char from 2 lines to obtain one 2x2 pattern for one character:
|XX| |X | |X | | |
|XX| -> '█' |XX| -> '▙' | X| -> '▚' | X| -> '▗' and so on...
Some samples: From
OOOOOO OOOOOO OOOOOO OOOOOOO OOOOOO OOOOOO OO OOOOOOO
OO OO OO OO OO OO OO OO OO OO OO
OO OO OO OO OO OOOOO OO OOO OO OO OO OOOOO
OO OO OO OO OO OO OO OO OO OO OO OO
OOOOOO OOOOOO OOOOOO OOOOOOO OOOOOO OOOOOO OOOOOOO OO
you have to render:
▟▀▀▘▟▀▀▙▐▛▀▙▐▛▀▀ ▗▛▀▀ ▟▀▀▙▐▌ ▐▛▀▀
█ █ █▐▌ █▐▛▀ ▐▌ ▜▌█ █▐▌ ▐▛▀
▝▀▀▘▝▀▀▘▝▀▀▘▝▀▀▀ ▀▀▀ ▝▀▀▘▝▀▀▀▝▘
And from:
OOOOOO OOOOOO OOOOOO OOOOOOO OOOOOO OOOOOO OO OOOOOOO
OO OO OO OO OO OO OO OO OO OO OO
OO OO OO OO OO OOOOO OO OOO OO OO OO OOOOO
OO OO OO OO OO OO OO OO OO OO OO OO
OOOOOO OOOOOO OOOOOO OOOOOOO OOOOOO OOOOOO OOOOOOO OO
Where 1st column hold spaces you may render:
▗▛▀▀▗▛▀▜▖█▀▜▖█▀▀▘ ▟▀▀▘▗▛▀▜▖█ █▀▀▘
▐▌ ▐▌ ▐▌█ ▐▌█▀▘ █ ▝█▐▌ ▐▌█ █▀▘
▀▀▀ ▀▀▀ ▀▀▀ ▀▀▀▘ ▝▀▀▘ ▀▀▀ ▀▀▀▘▀
Piping:
wget -O - https://codegolf.stackexchange.com/q/19123/9424 |
sed -ne '/<pre><code>/,/<\/code><\/pre>/{//{/\//q};s/<pre><code>//;p}'
('l2v2l6v2'+ 'e1l1v3l2'+
'v3e1v7e1v7e1v7e1l2v6e1l4v5'+
'e1l6v4e1l8v3e1l7l3v2e1l9l3v1')
.replace(/[lve]\d/g,function
(c){return Array(-~c[1]).
join({l:' ',v:'Love'
,e:'\n'}[c[0
]])})
must give:
▗▟█████▙▟█████▄
▜█████████████▛▘
▝▀███▙▛█████▀
▝▀▜██▀▘
Other samples on my terminal:
With standard rules:
- Input ASCII from STDIN or file, without special chars, tabulations or UTF-8.
- Each submited chars have to be represented, only whitespaces have to stay empty.
- This is code-golf too, so the lowest score win. Score is computed as:
+1
by chars, to be counted in chars, not in bytes!! Ie:s=' ▝▘▀▗▐▚▜▖▞▌▛▄▟▙█'
count for 20 chars, not 52 !!-10
for explanation;+20
for use of external font tool or library.
xterm -xrm 'XTerm*renderFont:false' &
to open a console window able to display this properly. \$\endgroup\$