Skip to main content
redumnant `-ne''`
Source Link
mazzy
  • 7.2k
  • 2
  • 13
  • 23

Powershell, 275 253253 248 bytes

param($n)$d='8 \83484/7/484302 92984308 92918--118--128||6//0\16116129558| \/ |8 /02083\6/10018/6\302 955776_71 9_7_' '8\,__,777,/6 /,\6/6\,_8 -- _,88,888, ,||||||'-split','-ne''|%'|%{$d=$d-replace+$i++,$_} 0..3|%{$l=$_;-join$d[(0..55|%{$_*8+$l*2+$n%2})]} 
$f = { param($n)$d='8 \83484/7/484302 92984308 92918--118--128||6//0\16116129558| \/ |8 /02083\6/10018/6\302 955776_71 9_7_' '8\,__,777,/6 /,\6/6\,_8 -- _,88,888, ,||||||'-split','-ne''|%'|%{$d=$d-replace+$i++,$_} 0..3|%{$l=$_;-join$d[(0..55|%{$_*8+$l*2+$n%2})]} } &$f 2 &$f 1 

Powershell, 275 253 bytes

param($n)$d='8 \83484/7/484302 92984308 92918--118--128||6//0\16116129558| \/ |8 /02083\6/10018/6\302 955776_71 9_7_' '8\,__,777,/6 /,\6/6\,_8 -- _,88,888, ,||||||'-split','-ne''|%{$d=$d-replace+$i++,$_} 0..3|%{$l=$_;-join$d[(0..55|%{$_*8+$l*2+$n%2})]} 
$f = { param($n)$d='8 \83484/7/484302 92984308 92918--118--128||6//0\16116129558| \/ |8 /02083\6/10018/6\302 955776_71 9_7_' '8\,__,777,/6 /,\6/6\,_8 -- _,88,888, ,||||||'-split','-ne''|%{$d=$d-replace+$i++,$_} 0..3|%{$l=$_;-join$d[(0..55|%{$_*8+$l*2+$n%2})]} } &$f 2 &$f 1 

Powershell, 275 253 248 bytes

param($n)$d='8 \83484/7/484302 92984308 92918--118--128||6//0\16116129558| \/ |8 /02083\6/10018/6\302 955776_71 9_7_' '8\,__,777,/6 /,\6/6\,_8 -- _,88,888, ,||||||'-split','|%{$d=$d-replace+$i++,$_} 0..3|%{$l=$_;-join$d[(0..55|%{$_*8+$l*2+$n%2})]} 
$f = { param($n)$d='8 \83484/7/484302 92984308 92918--118--128||6//0\16116129558| \/ |8 /02083\6/10018/6\302 955776_71 9_7_' '8\,__,777,/6 /,\6/6\,_8 -- _,88,888, ,||||||'-split','|%{$d=$d-replace+$i++,$_} 0..3|%{$l=$_;-join$d[(0..55|%{$_*8+$l*2+$n%2})]} } &$f 2 &$f 1 
comments
Source Link
mazzy
  • 7.2k
  • 2
  • 13
  • 23
$src = " __ __ __ __ ___", # art1line1, line1art1 " __ __ ", # art2line1, line1art2 " /\ /\ | |\ | | / | | /\ | | ", # art1line2, line2art1 "\ / | | /| | / | / \ __ / | | ", # art2line2, line2art2 " / \/ \ | | \ | |-- | |--\ /__\ |-- | ", # art1line3, line3art1 " \ /\ / | | / | |-- | |--/ \ / |-- | ", # art2line3, line3art2 "/ \ | | \| |__ \__ | \ / \ | | ", # art1line4, line4art1 " \/ \/ | |/ | |__ \__ |__| \/ |__ _|_" # art2line4, line4art2 $z=-join(0..$src[0].Length|%{ $p=$_ $src|%{$_[$p]} }) $z 
$src = " __ __ __ __ ___", # art1, line1 " __ __ ", # art2, line1 " /\ /\ | |\ | | / | | /\ | | ", # art1, line2 "\ / | | /| | / | / \ __ / | | ", # art2, line2 " / \/ \ | | \ | |-- | |--\ /__\ |-- | ", # art1, line3 " \ /\ / | | / | |-- | |--/ \ / |-- | ", # art2, line3 "/ \ | | \| |__ \__ | \ / \ | | ", # art1, line4 " \/ \/ | |/ | |__ \__ |__| \/ |__ _|_" # art2, line4 $z=-join(0..$src[0].Length|%{ $p=$_ $src|%{$_[$p]} }) $z 
$src = " __ __ __ __ ___", # line1, art1 " __ __ ", # line1, art2 " /\ /\ | |\ | | / | | /\ | | ", # line2, art1 "\ / | | /| | / | / \ __ / | | ", # line2, art2 " / \/ \ | | \ | |-- | |--\ /__\ |-- | ", # line3, art1 " \ /\ / | | / | |-- | |--/ \ / |-- | ", # line3, art2 "/ \ | | \| |__ \__ | \ / \ | | ", # line4, art1 " \/ \/ | |/ | |__ \__ |__| \/ |__ _|_" # line4, art2 $z=-join(0..$src[0].Length|%{ $p=$_ $src|%{$_[$p]} }) $z 
-22 bytes
Source Link
mazzy
  • 7.2k
  • 2
  • 13
  • 23

Powershell, 275275 253 bytes

param($n)$d='444442114112_64448667666 \7/ \7 / \83 95 \8/ 9548/357 |3 \86/_\83 9489 8\3/\\3/\2958/\89500548900/\4\/66/\290029 /8\ 3 \ 3\553\95112\\115_6 |8\7 /8\ 3\5_676 9_' '--__78/77779 _88 ||'-split'(..)'-ne''|%{$d=$d-replace+$i++,$_} -join$d[(0..450|?{$_%2-eq$n%2})] 
param($n)$d='8 \83484/7/484302 92984308 92918--118--128||6//0\16116129558| \/ |8 /02083\6/10018/6\302 955776_71 9_7_' '8\,__,777,/6 /,\6/6\,_8 -- _,88,888, ,||||||'-split','-ne''|%{$d=$d-replace+$i++,$_} 0..3|%{$l=$_;-join$d[(0..55|%{$_*8+$l*2+$n%2})]} 
$f = { param($n)$d='444442114112_64448667666 \7/ \7 / \83 95 \8/ 9548/357 |3 \86/_\83 9489 8\3/\\3/\2958/\89500548900/\4\/66/\290029 /8\ 3 \ 3\553\95112\\115_6 |8\7 /8\ 3\5_676 9_' # compressed even-odd combined logos '--__78/77779 _88 ||'-split'(..)'-ne''|%{$d=$d-replace+$i++,$_} # decompress using 10 consecutive replacements with 2-character strings -join$d[(0..450|?{$_%2-eq$n%2})] # choose even or odd characters and join to result string } &$f 2 &$f 1 
$f = { param($n)$d='8 \83484/7/484302 92984308 92918--118--128||6//0\16116129558| \/ |8 /02083\6/10018/6\302 955776_71 9_7_' '8\,__,777,/6 /,\6/6\,_8 -- _,88,888, ,||||||'-split','-ne''|%{$d=$d-replace+$i++,$_} 0..3|%{$l=$_;-join$d[(0..55|%{$_*8+$l*2+$n%2})]} } &$f 2 &$f 1 
 __ __ __ __ ___ /\ /\ | |\ | | / | | /\ | | / \/ \ | | \ | |-- | |--\ /__\ |-- | / \ | | \| |__ \__ | \ / \ | | __ __ \ / | | /| | / | / \ __ / | | \ /\ / | | / | |-- | |--/ \ / |-- | \/ \/ | |/ | |__ \__ |__| \/ |__ _|_ 
 __ __ __ __ ___ /\ /\ | |\ | | / | | /\ | | / \/ \ | | \ | |-- | |--\ /__\ |-- | / \ | | \| |__ \__ | \ / \ | | __ __ \ / | | /| | / | / \ __ / | | \ /\ / | | / | |-- | |--/ \ / |-- | \/ \/ | |/ | |__ \__ |__| \/ |__ _|_ 

In contrast to theThe compression method is extended method of CJam by Dennis♦, I used a simple rule: an even character is taken from the first ASCII art, and an odd - from the second. The even-odd decompression algorithm becomes much shorter.

  1. Create a string before compression:
    • chars of the first column of both ASCII arts, then
    • chars of the second column, then
    • chars of the third column and so on...
  2. Compress using 10 consecutive replacements (10 because Powershell can use numbers 0..9 as strings, this makes the decompress algorithm shorter. Replacements found by brute force.)

The beforescript for compression string is:

 ____ ____ _ _ _ _ _ _ _ \ / \ / \ / || || \ / || || // || |/ \ _/_\ / || || \/ /\\/ /\ || || /\ || ||---- || ||----/\ \/ _ _/\ ||---- || / \ / \ / \ || ||/ \|| ||____ \\____ ||_ _ | \ / \ / \ ||_ _ _ ||_ 
$src = " __ __ __ __ ___", # art1, line1 " __ __ ", # art2, line1 " /\ /\ | |\ | | / | | /\ | | ", # art1, line2 "\ / | | /| | / | / \ __ / | | ", # art2, line2 " / \/ \ | | \ | |-- | |--\ /__\ |-- | ", # art1, line3 " \ /\ / | | / | |-- | |--/ \ / |-- | ", # art2, line3 "/ \ | | \| |__ \__ | \ / \ | | ", # art1, line4 " \/ \/ | |/ | |__ \__ |__| \/ |__ _|_" # art2, line4 $z=-join(0..$src[0].Length|%{ $p=$_ $src|%{$_[$p]} }) $z 

I used a consecutive replacements forThe before compression. A small study has shown that 8-12 consecutive replacements are sufficient for this string. and it is enough to replace with strings from 2 to 6 characters. I used 10 consecutive replacements with 2-character strings. It significantly reduce the decompression algorithm.:

 \ / /\ / \ \ / \/ /\ / \ \ / \/ / \ |||||| |||||| \ / \/ / \ |||||| ||||||__ --____ --__ || // \\__ ____ __ ||||||_ -- __ -- _ | \/ | / \ \ / /\ /__ \ \__ / \/ / \ ||||||_ -- __ -- _ _ __ ||||||_ _ 

Powershell, 275 bytes

param($n)$d='444442114112_64448667666 \7/ \7 / \83 95 \8/ 9548/357 |3 \86/_\83 9489 8\3/\\3/\2958/\89500548900/\4\/66/\290029 /8\ 3 \ 3\553\95112\\115_6 |8\7 /8\ 3\5_676 9_' '--__78/77779 _88 ||'-split'(..)'-ne''|%{$d=$d-replace+$i++,$_} -join$d[(0..450|?{$_%2-eq$n%2})] 
$f = { param($n)$d='444442114112_64448667666 \7/ \7 / \83 95 \8/ 9548/357 |3 \86/_\83 9489 8\3/\\3/\2958/\89500548900/\4\/66/\290029 /8\ 3 \ 3\553\95112\\115_6 |8\7 /8\ 3\5_676 9_' # compressed even-odd combined logos '--__78/77779 _88 ||'-split'(..)'-ne''|%{$d=$d-replace+$i++,$_} # decompress using 10 consecutive replacements with 2-character strings -join$d[(0..450|?{$_%2-eq$n%2})] # choose even or odd characters and join to result string } &$f 2 &$f 1 
 __ __ __ __ ___ /\ /\ | |\ | | / | | /\ | | / \/ \ | | \ | |-- | |--\ /__\ |-- | / \ | | \| |__ \__ | \ / \ | | __ __ \ / | | /| | / | / \ __ / | | \ /\ / | | / | |-- | |--/ \ / |-- | \/ \/ | |/ | |__ \__ |__| \/ |__ _|_ 

In contrast to the CJam by Dennis♦, I used a simple rule: an even character is taken from the first ASCII art, and an odd - from the second. The even-odd decompression algorithm becomes much shorter.

The before compression string is:

 ____ ____ _ _ _ _ _ _ _ \ / \ / \ / || || \ / || || // || |/ \ _/_\ / || || \/ /\\/ /\ || || /\ || ||---- || ||----/\ \/ _ _/\ ||---- || / \ / \ / \ || ||/ \|| ||____ \\____ ||_ _ | \ / \ / \ ||_ _ _ ||_ 

I used a consecutive replacements for compression. A small study has shown that 8-12 consecutive replacements are sufficient for this string. and it is enough to replace with strings from 2 to 6 characters. I used 10 consecutive replacements with 2-character strings. It significantly reduce the decompression algorithm.

Powershell, 275 253 bytes

param($n)$d='8 \83484/7/484302 92984308 92918--118--128||6//0\16116129558| \/ |8 /02083\6/10018/6\302 955776_71 9_7_' '8\,__,777,/6 /,\6/6\,_8 -- _,88,888, ,||||||'-split','-ne''|%{$d=$d-replace+$i++,$_} 0..3|%{$l=$_;-join$d[(0..55|%{$_*8+$l*2+$n%2})]} 
$f = { param($n)$d='8 \83484/7/484302 92984308 92918--118--128||6//0\16116129558| \/ |8 /02083\6/10018/6\302 955776_71 9_7_' '8\,__,777,/6 /,\6/6\,_8 -- _,88,888, ,||||||'-split','-ne''|%{$d=$d-replace+$i++,$_} 0..3|%{$l=$_;-join$d[(0..55|%{$_*8+$l*2+$n%2})]} } &$f 2 &$f 1 
 __ __ __ __ ___ /\ /\ | |\ | | / | | /\ | | / \/ \ | | \ | |-- | |--\ /__\ |-- | / \ | | \| |__ \__ | \ / \ | | __ __ \ / | | /| | / | / \ __ / | | \ /\ / | | / | |-- | |--/ \ / |-- | \/ \/ | |/ | |__ \__ |__| \/ |__ _|_ 

The compression method is extended method of CJam by Dennis♦:

  1. Create a string before compression:
    • chars of the first column of both ASCII arts, then
    • chars of the second column, then
    • chars of the third column and so on...
  2. Compress using 10 consecutive replacements (10 because Powershell can use numbers 0..9 as strings, this makes the decompress algorithm shorter. Replacements found by brute force.)

The script for compression:

$src = " __ __ __ __ ___", # art1, line1 " __ __ ", # art2, line1 " /\ /\ | |\ | | / | | /\ | | ", # art1, line2 "\ / | | /| | / | / \ __ / | | ", # art2, line2 " / \/ \ | | \ | |-- | |--\ /__\ |-- | ", # art1, line3 " \ /\ / | | / | |-- | |--/ \ / |-- | ", # art2, line3 "/ \ | | \| |__ \__ | \ / \ | | ", # art1, line4 " \/ \/ | |/ | |__ \__ |__| \/ |__ _|_" # art2, line4 $z=-join(0..$src[0].Length|%{ $p=$_ $src|%{$_[$p]} }) $z 

The before compression string is:

 \ / /\ / \ \ / \/ /\ / \ \ / \/ / \ |||||| |||||| \ / \/ / \ |||||| ||||||__ --____ --__ || // \\__ ____ __ ||||||_ -- __ -- _ | \/ | / \ \ / /\ /__ \ \__ / \/ / \ ||||||_ -- __ -- _ _ __ ||||||_ _ 
Source Link
mazzy
  • 7.2k
  • 2
  • 13
  • 23
Loading