Problem
Recreate the UI from a torrent program
Given no input, output the following:
+----------+----------+----------+
|a.exe |##########|seeding |
+----------+----------+----------+
|b.exe 10% |# |leeching |
+----------+----------+----------+
|c.exe |##########|seeding |
+----------+----------+----------+
|d.exe 20% |## |leeching |
+----------+----------+----------+
|e.exe |##########|seeding |
+----------+----------+----------+
|f.exe 30% |### |leeching |
+----------+----------+----------+
|g.exe |##########|seeding |
+----------+----------+----------+
|h.exe 40% |#### |leeching |
+----------+----------+----------+
|i.exe |##########|seeding |
+----------+----------+----------+
|j.exe 50% |##### |leeching |
+----------+----------+----------+
|k.exe |##########|seeding |
+----------+----------+----------+
|l.exe 60% |###### |leeching |
+----------+----------+----------+
|m.exe |##########|seeding |
+----------+----------+----------+
|n.exe 70% |####### |leeching |
+----------+----------+----------+
|o.exe |##########|seeding |
+----------+----------+----------+
|p.exe 80% |######## |leeching |
+----------+----------+----------+
|q.exe |##########|seeding |
+----------+----------+----------+
|r.exe 90% |######### |leeching |
+----------+----------+----------+
|s.exe |##########|seeding |
+----------+----------+----------+
|t.exe |##########|seeding |
+----------+----------+----------+
|u.exe |##########|seeding |
+----------+----------+----------+
|v.exe |##########|seeding |
+----------+----------+----------+
|w.exe |##########|seeding |
+----------+----------+----------+
|x.exe |##########|seeding |
+----------+----------+----------+
|y.exe |##########|seeding |
+----------+----------+----------+
|z.exe |##########|seeding |
+----------+----------+----------+
progress for programs are:
b=10% d=20% f=30% h=40% j=50% l=60% n=70% p=80% r=90%
amount of #'s for leeching programs is progress/10
the rest are all seeding with full progress bars.
Rules
- Leading and trailing newlines allowed.
- Leading and trailing spaces allowed as long as it doesn't change shape of output.
- stdout and functions for output allowed.
- Shortest code in bytes win
31 Answers 31
Perl 5, 130 bytes
print$e=("+"."-"x10)x3 ."+
";printf"|$_.exe%4s |%-10s|%-9s |
$e",$|--&&$@++<9?("$@0%","#"x$@,leeching):("","#"x10,seeding)for a..z
I expect that there are a few bytes that can be golfed, but I've ran out of inspiration.
Short explanations:
$e contains the separation line (+----------+----------+----------+); its construction is straight forward (("+"."-"x10)x3 ."+\n").
Then, I loop over the characters from a to z:
Every time, print "|$_.exe%4s |%-10s|%-9s |\n$e; this is a standard printf with placeholders for strings (%s) and left-padded strings (%-9s).
if $|--&&$@++<9 is true ($| is a special variable that contains either 0 or 1, and decrementing it toggles its value), then the percentage is not 100%, and the three values in the print are "$@0%","#"x$@,leeching ($@0% is actually just $@ . "0" . "%" - remember that $@ was incremented earlier), otherwise, the three values are "","#"x10,seeding).
SOGL V0.12, (削除) 90 (削除ここまで) (削除) 89 (削除ここまで) 88 bytes
ēz{L┌* +3ΟQķ|;o".exe "oēI»L*"% |"e» #*lLκ@*"┌5%8'Ω7⁄8█≡θ1‘++++e'3>e2\+?X"1⁄3m÷Ko→∆)No(¤^▒«‘}o
Explanation:
ē push variable E (default = input, which default is 0) and increase it after (next ē call will result in 1, or next e call - 2)
z{ iterate over the lowercase alphabet
L┌* push 10 dashes
+ push "+"
3Ο encase 3 copies of the dashes in pluses
Q output in a new line, without popping and without disabling auto-output
ķ| output in a new line "|"
;o output the current iteration (the alphabet letter)
".exe "o output ".exe "
ē push E and increase the variable after
I increase it
5* multiply by 5 (every 2 ē calls this gets called)
"% |" push "% |"
e» push (E)/2
#* get that mant "#"s
l get the length of that string
Lκ push 10-length
@* push that many spaces
"..‘ push "|leeching |"
++++ add all those strings on the stack together ((e+1)*5, "% |", "#..#", " .. ", "|leeching |") (done this way to leave the "+-+-+-+" on the stack)
e'3> push e>19
e2\ push e divides by 2
+ add together (here works like OR)
? if that then
X remove the added-together string
"..‘ push " |##########|seeding |"
} END
o output POP (either the added string or full/seeding version)
implicitly output POP (since none of tTpP were called), which is the separator line
-
\$\begingroup\$ SOGL beats.... Charcoal?! \$\endgroup\$Mr. Xcoder– Mr. Xcoder2017年06月26日 13:08:00 +00:00Commented Jun 26, 2017 at 13:08
-
1\$\begingroup\$ @Mr.Xcoder It's the most common scenario imo. \$\endgroup\$Erik the Outgolfer– Erik the Outgolfer2017年06月26日 14:26:59 +00:00Commented Jun 26, 2017 at 14:26
-
\$\begingroup\$ Why the downvote? \$\endgroup\$dzaima– dzaima2017年06月27日 11:34:34 +00:00Commented Jun 27, 2017 at 11:34
Charcoal, (削除) 98 (削除ここまで) (削除) 85 (削除ここまで) 83 bytes
×ばつ11ι3M↘ .exe×ばつ#χ|seeding×ばつ4ι++ι10% ×ばつ 9|leeching×ばつ#ι
I thought copying a template would save me a lot of code but it all seems to add up somehow, although I managed to save 13 bytes by using a single loop to fix the 9 leeching rows. Explanation:
×ばつ11ι3 Make the top row of boxes
M↘ .exe×ばつ#χ|seeding⸿ Print .exe, the 10 #s and seeding
F25C0¦2 Make 25 copies of the boxes
↗Fβ↓+ι- Put the letters in at the start
F9« For the 9 leeching files
×ばつ4ι Move the cursor to the percentage column
++ι10% |# Print the percentage and the first # of progress
×ばつ 9|leeching Erase the rest of the progress and change the status
×ばつ#ι Print the desired amount of progress
(Side note: I seem to have discovered a bug in Charcoal; | is an ASCII character, but it's also counted as an arrow for the purposes of Multiprint, so you can't Multiprint it.)
-
\$\begingroup\$ Not a bug, you can escape it if you want \$\endgroup\$ASCII-only– ASCII-only2017年07月27日 03:14:48 +00:00Commented Jul 27, 2017 at 3:14
-
\$\begingroup\$ @ASCII-only Ah right, sadly the deverbosifier doesn't know that. \$\endgroup\$Neil– Neil2017年07月27日 07:47:36 +00:00Commented Jul 27, 2017 at 7:47
Python 2, (削除) 182 (削除ここまで) 177 bytes
Thanks to @officialaimm for shaving off 5 bytes by changing the format of the condition.
r=("+"+10*"-")*3+"+"
for i in range(26):z=i/2+1;print r+"\n|"+chr(97+i)+".exe "+[" |"+10*"#"+"|seeding ",`10*z`+"% |"+z*"#"+(10-z)*" "+"|leeching"][i%2and i<19]+" |"
print r
-
1\$\begingroup\$ 177 bytes \$\endgroup\$0xffcourse– 0xffcourse2017年06月26日 13:22:18 +00:00Commented Jun 26, 2017 at 13:22
-
1\$\begingroup\$ Nice! I've seen that a couple of times but didn't think of using it in this instance. May I update my answer with your solution? \$\endgroup\$Fedone– Fedone2017年06月26日 13:28:07 +00:00Commented Jun 26, 2017 at 13:28
-
\$\begingroup\$ Of course, you can update it. ;) \$\endgroup\$0xffcourse– 0xffcourse2017年06月26日 13:29:02 +00:00Commented Jun 26, 2017 at 13:29
-
\$\begingroup\$ 173 bytes \$\endgroup\$Sebastian Mendez– Sebastian Mendez2017年11月20日 15:38:14 +00:00Commented Nov 20, 2017 at 15:38
Javascript, (削除) 232 (削除ここまで) (削除) 230 (削除ここまで) (削除) 228 (削除ここまで) 226 bytes
(s='+----------'.repeat(3),p=0)=>[...'abcdefghijklmnopqrstuvwxyz'].map((c,i)=>(b=i%2,p=b?p+10:p,x=b&p<91,`${s}+'
|${c}.exe ${x?p+'%':' '} |${'#'.repeat(x?p/10:10).padEnd(10)}|${x?'leeching':'seeding '} |`)).join`
`+`
${s}+`
- -2 Bytes thanks to @Stephen S - Using default function parameters
- -2 Bytes thanks to OP - Replacing some spaces
- -2 Bytes thanks to @Shaggy - Destructuring alphabet string
Demo
f=
(s='+----------'.repeat(3),p=0)=>[...'abcdefghijklmnopqrstuvwxyz'].map((c,i)=>(b=i%2,p=b?p+10:p,x=b&p<91,`${s}+'
|${c}.exe ${x?p+'%':' '} |${'#'.repeat(x?p/10:10).padEnd(10)}|${x?'leeching':'seeding '} |`)).join`
`+`
${s}+`
console.log(f());
.as-console-wrapper { max-height: 100% !important; top: 0; }
-
\$\begingroup\$ The last line is missing. Also, the submission and the Snippet differ; "leeching" is missing from the submission, for example. \$\endgroup\$Shaggy– Shaggy2017年06月26日 12:22:23 +00:00Commented Jun 26, 2017 at 12:22
-
\$\begingroup\$ @Shaggy Answer updated - Thanks for the follow \$\endgroup\$Weedoze– Weedoze2017年06月26日 12:27:15 +00:00Commented Jun 26, 2017 at 12:27
-
-
\$\begingroup\$ I'm not sure but can't you change
${x?'leeching ':'seeding '}|to the following:${x?'leeching':'seeding '} |? \$\endgroup\$LiefdeWen– LiefdeWen2017年06月26日 12:50:29 +00:00Commented Jun 26, 2017 at 12:50 -
\$\begingroup\$ @LiefdeWen You are right ! Thanks \$\endgroup\$Weedoze– Weedoze2017年06月26日 12:54:15 +00:00Commented Jun 26, 2017 at 12:54
Braingolf, (削除) 673 (削除ここまで) 655 bytes
9..#+[#-]#+[#-]#+[#-]"+
|"!&@V"a.exe |"!&@V9[##]"|seeding |
"!&@v!&@v<1+>!&@V8##[# ]"|leeching |
"!&@v!&@v<1+>!&@v!&@vv!&@v<1+>!&@vv<<$_##>>!&@v!&@v<1+>!&@v!&@vv!&@v<1+>!&@vv<<<$_##>>>!&@v!&@v<1+>!&@v!&@vv!&@v<1+>!&@vv<<<<$_##>>>>!&@v!&@v<1+>!&@v!&@vv!&@v<1+>!&@vv<<<<$_##>>>>!&@v!&@v<1+>!&@v!&@vv!&@v<1+>!&@vv<<<<<$_##>>>>>!&@v!&@v<1+>!&@v!&@vv!&@v<1+>!&@vv<<<<<<$_##>>>>>>!&@v!&@v<1+>!&@v!&@vv!&@v<1+>!&@vv<<<<<<<$_##>>>>>>>!&@v!&@v<1+>!&@v!&@vv!&@v<1+>!&@vv<<<<<<<<$_##>>>>>>>>!&@v!&@v<1+>!&@v!&@vv!&@v<1+>!&@vv<<<<<<<<<$_##>>>>>>>>>!&@v!&@v<1+>!&@v!&@vv!&@v<1+>!&@v!&@vv!&@v<1+>!&@v!&@vv!&@v<1+>!&@v!&@vv!&@v<1+>!&@v!&@vv!&@v<1+>!&@v!&@vv$_!&@;
I've said it before and I'll say it again: Braingolf is bad at ASCII art.
At least this is only 1/3rd of the bytes it would take to actually hardcode the output
PHP, 179 bytes
without input
for($a=a;$x<53;++$x&1?:$a++)printf($x&1?"
|$a.exe%4s |%-10s|%-10s|
":str_pad("",34,"+----------"),($y=$x%4>2&$x<36?++$z:"")?$y."0%":"",str_repeat("#",$y?:10),$y?leeching:seeding);
PHP, 176 bytes
with input
for($a=a;$x<53;)printf($x&1?"
|$a.exe%4s |%-10s|%-10s|
":str_pad("",34,"+----------"),($y=strstr($argn,++$x&1?:$a++)[2])?$y."0%":"",str_repeat("#",$y?:10),$y?leeching:seeding);
-
\$\begingroup\$ Save 9 bytes from the first version: remove
++from++$x&1(-2), use$y=++$x%4|$z>9?"":++$z."0%"as secondprintfparameter (-9) and insert$zbefore:10(+2) \$\endgroup\$Titus– Titus2018年04月06日 16:07:37 +00:00Commented Apr 6, 2018 at 16:07
V, 107 bytes
¬azÓ./|&.exeò
ddÎAμ |±°#|seeding3 |
ÙÒ-4ñr+11lñddç^/P
jp4G9ñ8|R00%3l10r llRleeching4jñV{10g
çä/WylWl@"r#
Hexdump:
00000000: ac61 7ad3 2e2f 7c26 2e65 7865 f20a 6464 .az../|&.exe..dd
00000010: ce41 b520 7cb1 b023 7c73 6565 6469 6e67 .A. |..#|seeding
00000020: b320 7c0a d9d2 2d34 f172 2b31 316c f164 . |...-4.r+11l.d
00000030: 64e7 5e2f 500a 6a70 3447 39f1 387c 5230 d.^/P.jp4G9.8|R0
00000040: 3025 1b33 6c31 3072 206c 6c52 6c65 6563 0%.3l10r llRleec
00000050: 6869 6e67 1b34 6af1 567b 3130 6701 0ae7 hing.4j.V{10g...
00000060: e42f 5779 6c57 6c40 2272 23 ./WylWl@"r#
Java (OpenJDK 8), (削除) 244 (削除ここまで) (削除) 229 (削除ここまで) (削除) 228 (削除ここまで) (削除) 227 (削除ここまで) (削除) 226 (削除ここまで) (削除) 224 (削除ここまで) (削除) 222 (削除ここまで) (削除) 218 (削除ここまで) 217 bytes
o->{String x="----------+",z="+"+x+x+x,s=z;for(int c=96,p;++c<123;s+=s.format("%n|%c.exe%4s |%-10s|%-10s|%n"+z,c,p>9?"":p+"0%","##########".substring(0,p),p>9?"seeding":"leeching"))p=(p=c/2-48)>9|c%2>0?10:p;return s;}
-2 bytes thanks to @KevinCruijssen!
-
\$\begingroup\$ Your
leechingandseedingare right aligned. \$\endgroup\$LiefdeWen– LiefdeWen2017年06月27日 12:51:37 +00:00Commented Jun 27, 2017 at 12:51 -
\$\begingroup\$ Wow, fast comment! I just saw after posting and was busy fixing it :p \$\endgroup\$Olivier Grégoire– Olivier Grégoire2017年06月27日 12:52:49 +00:00Commented Jun 27, 2017 at 12:52
-
\$\begingroup\$ Sorry for being a nuissance, I just get excited seeing readable good \$\endgroup\$LiefdeWen– LiefdeWen2017年06月27日 12:54:55 +00:00Commented Jun 27, 2017 at 12:54
-
\$\begingroup\$ Nuisance? No, you weren't :) \$\endgroup\$Olivier Grégoire– Olivier Grégoire2017年06月27日 12:55:44 +00:00Commented Jun 27, 2017 at 12:55
-
1\$\begingroup\$ Dangit.. While I was fixing and adding an explanation to my answer you've beat me to it.. And 34 bytes shorter I might add.. I see some simularities, but smart use of the
.formatand0%, +1! Btw, you can golf your answer some more by starting withs=zinstead, like this:o->{String x="----------+",z="+"+x+x+x,s=z;for(int c=96,p;++c<123;)s+=s.format("%n|%c.exe %3s |%-10s|%-10s|%n"+z,c,(p=(c%2>0|c/2-48>10)?10:c/2-48)<10?p+"0%":"","##########".substring(0,p),p<10?"leeching":"seeding");return s;}(225 bytes) \$\endgroup\$Kevin Cruijssen– Kevin Cruijssen2017年06月27日 13:30:50 +00:00Commented Jun 27, 2017 at 13:30
Plain TeX, 306 bytes
\let\a\advance\def\b{+\r{\r-9-+}3\par}\def\s{\r~5|\r\#9\#|seeding\r~3|}\def\r#1#2{{\i0\loop#1\a\i1
\ifnum\i<#2\repeat}}\newcount\i\i`a\newcount\j\j1\tt\loop\b|\char\i.exe\ifodd\i\s\else\ifnum\i<`s\
\the\j0\%~|\r\#\j{\j-\j \a\j10 \r~\j}\a\j1|leeching\r~2|\else\s\fi\fi\endgraf\a\i1 \ifnum\i<`\{\repeat\b\bye
Ungolfed with some explanations:
\let\a\advance
\def\b{+\r{\r-9-+}3\par}% The bar between rows: '+' + 3*(9*'-' + '-' + '+') + '\n'
\def\s{\r~5|\r\#9\#|seeding\r~3|}% The common part for seeding lines, similar to \b
\def\r#1#2{{% Macro for repeating #1 #2 times
% Note the local grouping here which is needed for nested \loops and allows us to reuse the global \i
\i0%
\loop
#1%
\a\i1 %
\ifnum\i<#2%
\repeat%
}}%
\newcount\i \i`a% Counter for ASCII values of letters, start with 'a'
\newcount\j \j1% Counter for percentages; shorter than modulo tricks
\tt
\loop
\b|\char\i.exe%
\ifodd\i
\s% Odd lines are seeding lines
\else
\ifnum\i<`s\ % Even line up to 'r'
\the\j0\%~|\r\#\j% Print percentage and progress bar
{\j-\j \a\j10 \r~\j}% 10-\j spaces after the progress bar
\a\j1%
|leeching\r~2|%
\else
\s% There's no \ifeven, hence the repetition here
\fi
\fi
\endgraf% Print '\n'. \par doesn't work here, because \loop isn't a \long macro
\a\i1
\ifnum\i<`\{% Repeat until \j <= 'z'
\repeat
\b
\bye
Python 3, 255 bytes
I'm sure this can be golfed, updating soon:
e,l='.exe ',('+'+10*'-')*3+"+";print(l)
for i in zip(['|'+chr(z)+e+' |'+"#"*10+'|seeding |'if z%2or z>115else'|'+chr(z)+e+str((z-96)//2*10)+'% |'+(z-96)//2*"#"+(10-(z-96)//2)*" "+"|leeching |"for z in range(97,123)],[l]*26):print(i[0],i[1],sep="\n")
-
\$\begingroup\$ instead of
leeching |andseeding |, can't you change it intoleechingandseeding+" |"? \$\endgroup\$LiefdeWen– LiefdeWen2017年06月26日 15:40:46 +00:00Commented Jun 26, 2017 at 15:40 -
\$\begingroup\$ @LiefdeWen I'm afraid that's 8 bytes longer... \$\endgroup\$Mr. Xcoder– Mr. Xcoder2017年06月26日 18:56:30 +00:00Commented Jun 26, 2017 at 18:56
-
\$\begingroup\$ Come on, "updating soon"? Anyway 246 bytes with list splat and and/or. \$\endgroup\$user202729– user2027292018年04月06日 02:11:20 +00:00Commented Apr 6, 2018 at 2:11
-
\$\begingroup\$ Also,
//2*10is just*5and10-(z-96)//2is just58-z//2. \$\endgroup\$user202729– user2027292018年04月06日 02:13:00 +00:00Commented Apr 6, 2018 at 2:13
Japt, 98 bytes
;27Æ4î+ ¬q-pU=10ÃíC¬£'|2¬q[X+".exe {W=Yu ©°T<U©T*U ?W+'%:P}"'#pW/UaU `äÊA Ð:g` ̧g!W]m!hUî)q|})c ·
Doesn't work in the latest version due to a bug that messes up 4î+, q-p10, and q|, but it does work in commit f619c52. Test it online!
T-SQL, 238 bytes
DECLARE @ INT=1,@D CHAR(11)='+----------'L:PRINT @D+@D+@D+'+
|'+CHAR(@+96)+'.exe '+IIF(@%2=0AND
@<20,CONCAT(@/2,'0% |',REPLICATE('#',@/2),SPACE(10-@/2),'|leeching |'),' |##########|seeding |')SET @+=1IF @<27GOTO L
PRINT @D+@D+@D+'+'
Procedural solution, formatted:
DECLARE @ INT=1, @D CHAR(11)='+----------'
L:
PRINT @D + @D + @D + '+
|' + CHAR(@+96) + '.exe ' +
IIF(@%2=0 AND @<20,
CONCAT(@/2,'0% |',REPLICATE('#',@/2),SPACE(10-@/2),'|leeching |'),
' |##########|seeding |')
SET @+=1
IF @<27 GOTO L
PRINT @D + @D + @D + '+'
Everything in the loop (up until the SET) is part of the same PRINT statement, including a line break inside the first string literal.
I'm working on a set-based solution (create and populate a table, then SELECT from it), but I'm not sure if its going to be smaller or not.
Java 8, (削除) 271 (削除ここまで) (削除) 263 (削除ここまで) 262 bytes
o->{String a="+----------",b=a+a+a+"+\n",r=b;for(int c=96,t;++c<123;r+="|"+(char)c+".exe "+(t>0?(c/2-48)+"0%":" ")+" |##########".substring(0,t>0?c/2-46:12)+" |".substring(t>0?c/2-49:9)+(t>0?"leeching":"seeding ")+" |\n"+b)t=c<115&c%2<1?1:0;return r;}
All this trouble for nothing.. >.> ;)
(Shorter Java answer by @OliverGrégoire.)
Explanation:
o->{ // Method with unused Object parameter and String return-type
String a="+----------",b=a+a+a+"+\n",
// Temp String "+----------+----------+----------+\n"
r=b; // Result-String
for(int c=96,t;++c<123 // Loop from 'a' to 'z':
; // After every iteration:
r+= // Append the result-String with:
"|" // A literal "|"
+(char)c // + the character
+".exe " // + literal ".exe "
+(t>0? // If the current character is below 's' and even unicode:
(c/2-48)+"0%" // + the percentage
: // Else:
" ") // + the spaces
+" |##########" // + the progress bar
.substring(0, // By using a substring from 0 to
t>0? // If the current character is below 's' and even unicode:
c/2-46 // 'b' = 3; 'd' = 4; 'f' = 6; etc.
: // Else:
12) // 12 (the entire progress bar)
+" |" // + spaces after the progress bar
.substring( // By using a substring from
t>0? // If the current character is below 's' and even unicode:
c/2-49 // 'b' = 0; 'd' = 1; 'f' = 2; etc.
: // Else:
9) // 9 (all the spaces)
+(t>0? // If the current character is below 's' and even unicode:
"leeching" // + literal "leeching"
: // Else:
"seeding ") // + literal "seeding "
+" |\n" // + literal " |" + new-line
+b) // + `b` ("+----------+----------+----------+\n")
t=c<115&c%2<1? // If the current character is below 's' and even unicode:
1 // `t` = 1
: // Else:
0; // `t` = 0
// End of loop
return r; // Return the result-String
} // End of method
-
\$\begingroup\$ Use a
charinstead of anintin the loop. It allows you to not cast it later on.tcan be initialized and reinitialized to zero and+=afterwards. It should still be shorter. \$\endgroup\$Olivier Grégoire– Olivier Grégoire2017年06月27日 13:18:47 +00:00Commented Jun 27, 2017 at 13:18 -
\$\begingroup\$ @OlivierGrégoire It's actually 2 bytes longer.
int&(char)&t=...;vschar&{t=1;t*=...;}. Unless I'm missing something. \$\endgroup\$Kevin Cruijssen– Kevin Cruijssen2017年06月27日 13:52:54 +00:00Commented Jun 27, 2017 at 13:52 -
\$\begingroup\$ No you're not missing anything, that was my idea. I didn't take some other parts of your code in account. \$\endgroup\$Olivier Grégoire– Olivier Grégoire2017年06月27日 14:15:37 +00:00Commented Jun 27, 2017 at 14:15
Charcoal, (削除) 154 149 143 130 (削除ここまで) 103 bytes
A5δFβ«F3«+χ»+⸿A∨%δ2›δ95θ|ι.exe⎇θ... 5++ δ% 0|⎇θ...#χ+...#∕δχ... −χ∕δχ⎇θ|seeding |⸿↧|leeching |⸿A+5δδ»F3«+χ»+
Try it online! (Link to verbose version.)
- 27 bytes saves thanks to Neil's master Charcoaling techniques.
-
\$\begingroup\$ You can save a whole boatload of bytes by using
\\r: Try it online!. Note that I've inserted dummy operations because I'm not getting any separators. \$\endgroup\$Neil– Neil2017年06月28日 10:58:16 +00:00Commented Jun 28, 2017 at 10:58 -
\$\begingroup\$ @Neil indeed, it seems that succesive printings are shorter than summing up chunks and printing the whole string. Not to mention the
\rtrick, I didn't know that. \$\endgroup\$Charlie– Charlie2017年06月28日 11:10:00 +00:00Commented Jun 28, 2017 at 11:10
05AB1E, 120 bytes
AS".exe"×ばつS9L‚ζJJðK€H©T*т%εD0Q_i×ばつT®-úí"leeching seeding "Tô®TQè)×ばつ'+ì¶.øý
There's way too much golfing to do here, will post explanation when I'm below 90 bytes.
Stax, (削除) 53 (削除ここまで) (削除) 68 (削除ここまで) 64 bytes
â"{≤╞c~£ÿτδ¬│∙}Dgoô₧»öÖ#9▌ó♂i◘ÿkùâGCå`è╙/♠Gδb,φW0EqΔ┘δth1⁄2àJZ¿l╦#
Unpacked and ungolfed it looks like this.
'+'-A*+34:mQ
VaF
'|p
".exe "+
|;i^hA?X
$.0%+
xA<Y*+G
'#x*G
`Qz/"D?d=T"`jy@G
zP
Q
}A(p'|p
Note that if you use the "Golf" button to remove whitespace and comments from the expanded solution, it incorrectly doubles the }. If you remove the extra character, it continues to work correctly.
Python 2, (削除) 172 (削除ここまで) (削除) 170 (削除ここまで) 162 bytes
-8 bytes thanks to Lynn
for i in range(2,28)+[id]:print('+'+'-'*10)*3+'+';a=i/2;b=i%2*(i<20);print('|'+'%-10s|'*3)%('%c.exe '%(95+i)+'%d0%%'%a*b,'#'*(a*b or 10),'sleeeedcihnign g'[b::2])
C (gcc), (削除) 217 (削除ここまで) 211 bytes
-6 bytes thanks to ceilingcat
#define B"+----------"
f(p){for(char*a,*l=" bdfhjlnpr",i=97;puts(B B B"+"),i<'{';printf("|%c.exe %.*d%s |%-10.*s|%s |\n",i++,!!a,p%10,a?"0%":" ",p=a?a-l:10,"##########",a?"leeching":"seeding "))a=index(l,i);}
///, 264 bytes
/~/\/\///!/---~@/!!!-~$/@+@+@~</+
|~>/|
+~(/###~*/ ~}/|leeching*~[/.exe ~;/0% |~{/[**|(((#|seeding* ~]/>$</+$<a{]b[1;# ****}]c{]d[2;##****}]e{]f[3;( ***}]g{]h[4;(#***}]i{]j[5;(## **}]k{]l[6;((**}]m{]n[7;#((* }]o{]p[8;##((*}]q{]r[9;((( }]s{]t{]u{]v{]w{]x{]y{]z{>$+
Works by defining a bunch of replacements and using them to replace more characters than they are.
Mathematica, 274 bytes
a=Alphabet[];n=StringPadRight;o=ToString;Column@Join[Row/@Table[{g="+----------+----------+----------+\n","|"<>o@a[[i]]<>".exe ",If[EvenQ@i&&i<20,s=o[5i]<>"% ";k="|"<>Table["#",i/2];f="leeching";,k="|##########";f="seeding";s=" "];s,n[k,11]<>"|",n[f,10],"|"},{i,26}],{g}]
Bubblegum, 150 bytes
00000000: e007 3d00 8c5d 0015 8b71 ec14 6414 8031 ..=..]...q..d..1
00000010: 7fc3 2b24 3568 ca81 7ab5 363e c3b7 f500 ..+5ドルh..z.6>....
00000020: c926 d3f0 55d9 926f 75a8 f8d0 806f 1f12 .&..U..ou....o..
00000030: d71f b824 7e75 a7f2 544f 0364 ee5e 98be ...$~u..TO.d.^..
00000040: a327 c36c 2ff1 8e6e df94 858e 82d0 d9da .'.l/..n........
00000050: 77d6 fac6 5548 64aa 7a29 78fa 6886 3c85 w...UHd.z)x.h.<.
00000060: 0494 905e 74de a209 e927 42c8 418d 8250 ...^t....'B.A..P
00000070: ee39 c16b a4c2 9add 0b17 f8b0 9984 9aa8 .9.k............
00000080: defb 2875 31a9 c136 0ec2 6f28 9f8c 9990 ..(u1..6..o(....
00000090: 10d4 0000 0d0a ......
Lua, 380 bytes
s=string.gsub
r=string.rep
function l(i)return".exe "..i.."0% |"..r("#",i)..r(" ",10-i).."|leeching |\n"end
print((s(s("Z|aY|b"..l(1).."Z|cY|d"..l(2).."Z|eY|f"..l(3).."Z|gY|h"..l(4).."Z|iY|j"..l(5).."Z|kY|l"..l(6).."Z|mY|n"..l(7).."Z|oY|p"..l(8).."Z|qY|r"..l(9).."Z|sY|tY|uY|vY|wY|xY|yY|zY","Y",".exe |##########|seeding |\nZ"),"Z","+----------+----------+----------+\n")))
Uses gsub to create the row dividers and the seeding rows. l generates the leeching rows. Renaming gsub and rep saves more bytes.
Jstx, 126 bytes
►-○しろまるEO.♥/(:►+:1►+;+₧D0%4►|22♫♥φézï2♂bdfhjlnpr♀*U!↑)☺:♣<!,♂% |♀:2&₧#=-₧#/')▬►#◙')§► ◙21♫♠~√╫WσΓÇ2◙↓♫♥¿Ç~√₧#/►#:1♫♣~√▐┬╞¿:2◙►|41%
Explanation
►- # Push literal -
○しろまる # Push literal 9
E # Push the second stack value the absolute value of the first stack value times.
O # Collapse all stack values into a string, then push that string.
. # Store the first stack value in the d register.
♥ # Push literal 3
/ # Enter an iteration block over the first stack value.
( # Push the value contained in the d register.
: # Push the sum of the second and first stack values.
►+ # Push literal +
: # Push the sum of the second and first stack values.
1 # End an iteration block.
►+ # Push literal +
; # Push the difference of the second and first stack values.
+ # Store the first stack value in the a register.
₧D # Push literal abcdefghijklmnopqrstuvwxyz
0 # Enter an iteration block over the first stack value and push the iteration element register at the beginning of each loop.
% # Push the value contained in the a register.
4 # Print the first stack value, then a newline.
►| # Push literal |
2 # Print the first stack value.
2 # Print the first stack value.
♫♥φézï # Push literal .exe
2 # Print the first stack value.
♂bdfhjlnpr♀ # Push literal bdfhjlnpr
* # Push the value contained in the iteration element register.
U # Push a true if the second stack value contains the first stack value, else false.
! # Push a copy of the first stack value.
↑ # Enter a conditional block if first stack value exactly equals true.
) # Push the value contained in the iteration index register.
☺ # Push literal 1
: # Push the sum of the second and first stack values.
♣ # Push literal 5
< # Push the product of the second and first stack values.
! # Push a copy of the first stack value.
, # Store the first stack value in the b register.
♂% |♀ # Push literal % |
: # Push the sum of the second and first stack values.
2 # Print the first stack value.
& # Push the value contained in the b register.
₧# # Push literal 10
= # Push the quotient of the second and first stack values.
- # Store the first stack value in the c register.
₧# # Push literal 10
/ # Enter an iteration block over the first stack value.
' # Push the value contained in the c register.
) # Push the value contained in the iteration index register.
▬ # Enter a conditional block if the second stack value is less than the top stack value.
►# # Push literal #
◙ # End a conditional block.
' # Push the value contained in the c register.
) # Push the value contained in the iteration index register.
§ # Enter a conditional block if the second stack value is greater than or equal to the top stack value.
► # Push literal
◙ # End a conditional block.
2 # Print the first stack value.
1 # End an iteration block.
♫♠~√╫WσΓÇ # Push literal |leeching
2 # Print the first stack value.
◙ # End a conditional block.
↓ # Enter a conditional block if first stack value exactly equals false.
♫♥¿Ç~√ # Push literal |
₧# # Push literal 10
/ # Enter an iteration block over the first stack value.
►# # Push literal #
: # Push the sum of the second and first stack values.
1 # End an iteration block.
♫♣~√▐┬╞¿ # Push literal |seeding
: # Push the sum of the second and first stack values.
2 # Print the first stack value.
◙ # End a conditional block.
►| # Push literal |
4 # Print the first stack value, then a newline.
1 # End an iteration block.
% # Push the value contained in the a register.
# Implied println upon termination.
I'm sure this can get significantly shorter.
///, 226 bytes
/;/ "//:/$$$+//,/0% |//*/###//)/ //(/!
|//'/,*//&/.exe //$/+----------//"/ |leeching |
:
|//!/&) |***#|seeding)|
:/:
|a(b&1,#)) ;c(d&2,##));e(f&3'))"g(h&4'#) ;i(j&5'##);k(l&6'*)"m(n&7'*# ;o(p&8'*##;q(r&9'**"s(t(u(v(w(x(y(z!
A bit more sophisticated approach to defining replacements. Try it interactively here!
Pascal (FPC), (削除) 294 (削除ここまで) (削除) 286 (削除ここまで) (削除) 266 (削除ここまで) 263 bytes
const m='----------+';Q=#10'+'+m+m+m+#10;S='.exe |##########|seeding |'+Q;var i:word;begin write(Q);for i:=1to 9do write('|',chr(95+i*2),S,'|',chr(96+i*2),'.exe ',i,'0% |',StringOfChar('#',i),'|leeching |':22-i,Q);for i:=115to 122do write('|',chr(i),S)end.
So... I ended up with both leading and trailing newline :D
PowerShell, (削除) 224 (削除ここまで) (削除) 210 (削除ここまで) (削除) 181 (削除ここまで) (削除) 174 (削除ここまで) (削除) 169 (削除ここまで) 160 bytes
$l=("+"+"-"*10)*3+"+
"
0..25|%{"$l|$([char](97+$_)).exe "+(" |$("#"*10)|seeding ",("$(++$c/2)0% |{0,-10}|leeching"-f("#"*($c/2))))[$_%2-and$_-lt18]+" |"}
$l
Now 64 bytes less terrible
Some Neat tricks: Combining a lot of "$(stuff)" to save on parens. We want only odd numbers which makes $_%2 = 1 so we don't need an -eq for it. Now uses list indexing instead of an if-else to save 5 bytes. Also gets rid of an `n for another byte. I couldn't get "$c`0%" to separate the var and zero so the current route was 1 byte shorter than gluing two strings together. Now with -f formatting.
Deadfish~, 5782 bytes
{iiii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{ddd}iiic{ddddd}dc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{dd}ddddddc{ddddd}ddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}ic{ii}dddcdc{d}dcdddddc{{i}d}iic{{d}i}icdddccccccccc{{i}d}iic{d}ddddddc{d}iiiccddciiiiiciciiiiic{d}iiic{{d}iii}dcc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{dd}dddddc{ddddd}dddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{dd}ddddc{ddddd}ddddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}ic{ii}ddcddc{d}dcdddddc{{i}d}iic{{d}i}iccdddcccccccc{{i}d}iic{d}ddddddc{d}iiiccddciiiiiciciiiiic{d}iiic{{d}iii}dcc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{dd}dddc{ddddd}dddddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{dd}ddc{ddddd}ddddddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}ic{ii}dcdddc{d}dcdddddc{{i}d}iic{{d}i}icccdddccccccc{{i}d}iic{d}ddddddc{d}iiiccddciiiiiciciiiiic{d}iiic{{d}iii}dcc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{dd}dc{dddddd}iiic{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{dd}c{dddddd}iic{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}ic{ii}cddddc{d}dcdddddc{{i}d}iic{{d}i}iccccdddcccccc{{i}d}iic{d}ddddddc{d}iiiccddciiiiiciciiiiic{d}iiic{{d}iii}dcc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{dd}ic{dddddd}ic{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{dd}iic{dddddd}c{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}ic{ii}icdddddc{d}dcdddddc{{i}d}iic{{d}i}icccccdddccccc{{i}d}iic{d}ddddddc{d}iiiccddciiiiiciciiiiic{d}iiic{{d}iii}dcc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{dd}iiic{dddddd}dc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{d}ddddddc{dddddd}ddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}ic{ii}iicddddddc{d}dcdddddc{{i}d}iic{{d}i}iccccccdddcccc{{i}d}iic{d}ddddddc{d}iiiccddciiiiiciciiiiic{d}iiic{{d}iii}dcc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{d}dddddc{dddddd}dddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{d}ddddc{dddddd}ddddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}ic{ii}iiic{d}iiic{d}dcdddddc{{i}d}iic{{d}i}icccccccdddccc{{i}d}iic{d}ddddddc{d}iiiccddciiiiiciciiiiic{d}iiic{{d}iii}dcc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{d}dddc{dddddd}dddddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{d}ddc{dddddd}ddddddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}ic{ii}iiiic{d}iic{d}dcdddddc{{i}d}iic{{d}i}iccccccccdddcc{{i}d}iic{d}ddddddc{d}iiiccddciiiiiciciiiiic{d}iiic{{d}iii}dcc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{d}dc{{d}iii}iiic{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{d}c{{d}iii}iic{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}ic{ii}iiiiic{d}ic{d}dcdddddc{{i}d}iic{{d}i}icccccccccdddc{{i}d}iic{d}ddddddc{d}iiiccddciiiiiciciiiiic{d}iiic{{d}iii}dcc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{d}ic{{d}iii}ic{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{d}iic{{d}iii}c{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiic{d}iiic{{d}iii}dc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiicddddddc{{d}iii}ddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiicdddddc{{d}iii}dddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiicddddc{{d}iii}ddddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiicdddc{{d}iii}dddddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc{ddd}dddc{{i}}{i}iiiicddc{{d}iii}ddddddc{iiiii}iiiiic{ii}dc{dd}ic{{d}iii}iccccc{{i}d}iic{{d}i}i{c}{{i}d}dc{d}ic{d}ddddccdciiiiiciiiiic{d}iiic{{d}iii}dccc{{i}d}iic{{d}}{d}ddddc{iii}iiicii{c}ddcii{c}ddcii{c}ddc
If this was code-bowling...
Explore related questions
See similar questions with these tags.
.exefrom torrents is not the brightest thing to do, eh? \$\endgroup\$f.execan't find a copy of it anywhere else. \$\endgroup\$f.execomes withf_readme.txtthat says, "run as administrator". Seems legit. \$\endgroup\$