从洪流程序重新创建UI
如果没有输入,则输出以下内容:
+----------+----------+----------+
|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 |
+----------+----------+----------+各项方案的进展情况如下:
b=10% d=20% f=30% h=40% j=50% l=60% n=70% p=80% r=90%
#'s用于抽吸程序的数量为progress/10
其余的都是带有完整进度条的seeding。
发布于 2017-06-26 12:36:41
发布于 2017-06-30 22:44:52
\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给出一些解释:
\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发布于 2017-06-26 15:10:06
¬azÓ./|&.exeò
ddÎAµ |±°#|seeding³ |
ÙÒ-4ñr+11lñddç^/P
jp4G9ñ8|R00%3l10r llRleeching4jñV{10g
çä/WylWl@"r#六角山:
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#https://codegolf.stackexchange.com/questions/128391
复制相似问题