torrent UI的ASCII艺术


30

问题

从Torrent程序重新创建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%

#的用于榨取程序是progress/10

其余的都seeding带有完整的进度条。

规则

  • 允许使用换行符开头和结尾。
  • 只要不改变输出形状,就允许使用前导和尾随空格。
  • 标准输出和允许输出的功能。
  • 以字节为单位的最短代码获胜

5
您知道.exe从洪流下载并不是最聪明的事情,是吗?
RobAu

14
@RobAu我将如何获得其他地方f.exe找不到它的副本。
LiefdeWen

9
f.exe附带f_readme.txt说“以管理员身份运行”。似乎是合法的。
Magic Octopus Urn

@RobAu我不知道,我会例行下载Linux发行版,其中包含可执行文件,其中包括一些安装了引导加载程序以及torrent的可执行文件!
Pascal Cuoq

Answers:


5

木炭,98 85 83字节

F³B⁻³⁴×¹¹ι³M↘ .exeM⁶→×#χ|seeding⸿F²⁵C⁰¦²↗Fβ↓⁺ι-F⁹«J⁷⁺³×⁴ι⁺⁺ι¹0% |#P⁺× ⁹|leeching×#ι

我以为复制一个模板可以节省很多代码,但是这似乎总能以某种方式加起来,尽管我设法通过使用单个循环来修复9个泄漏行来节省了13个字节。说明:

F³B⁻³⁴×¹¹ι³             Make the top row of boxes
M↘ .exeM⁶→×#χ|seeding⸿  Print .exe, the 10 #s and seeding
F²⁵C⁰¦²                 Make 25 copies of the boxes
↗Fβ↓⁺ι-                 Put the letters in at the start
F⁹«                     For the 9 leeching files
   J⁷⁺³×⁴ι              Move the cursor to the percentage column
   ⁺⁺ι¹0% |#            Print the percentage and the first # of progress
   P⁺× ⁹|leeching       Erase the rest of the progress and change the status
   ×#ι                  Print the desired amount of progress

(旁注:我似乎在木炭中发现了一个错误;这|是一个ASCII字符,但出于的目的,它也被视为箭头Multiprint,因此您不能这样Multiprint做。)


不是一个错误,你可以逃避它,如果你想
ASCII-仅

仅限@ASCII正确,可悲的是,混响器不知道这一点。
尼尔

哦,真的,提醒我感谢
ASCII-仅

12

Perl 5,130个字节

print$e=("+"."-"x10)x3 ."+
";printf"|$_.exe%4s |%-10s|%-9s |
$e",$|--&&$@++<9?("$@0%","#"x$@,leeching):("","#"x10,seeding)for a..z

在线尝试!

我希望可以打高尔夫球,但是我已经没有灵感了。

简短说明:
$e包含分隔线(+----------+----------+----------+);它的构造很简单(("+"."-"x10)x3 ."+\n")。
然后,我将字符从循环az
每次打印"|$_.exe%4s |%-10s|%-9s |\n$e;这是一个printf带有字符串(%s)和左填充字符串(%-9s)占位符的标准。
如果$|--&&$@++<9为true($|是一个包含0或1的特殊变量,并对其进行递减将切换其值),则该百分比不是100%,并且打印中的三个值是"$@0%","#"x$@,leeching$@0%实际上是$@ . "0" . "%"-请记住,之前$@已递增) ,否则,这三个值是"","#"x10,seeding)。


6

Python 2中182个 177字节

感谢@officialaimm通过更改条件格式减少了5个字节。

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
真好!我已经看过几次了,但是没有想到要在这种情况下使用它。我可以用您的解决方案更新答案吗?
Fedone

当然,您可以对其进行更新。;)
Officialaimm


6

SOGL V0.1290个 89 88 字节

ēz{L┌* +3ΟQķ|;o".exe ”oēI»L*"% |”e» #*lLκ@*"┌5%8'Ω⅞█≡θ¹‘++++e'³>e2\+?X"⅓m÷Ko→∆)№(¤^▒«‘}o

在这里尝试!

说明:

ē                                 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'³>              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

SOGL跳动...。木炭?!
Xcoder先生17年

1
@ Mr.Xcoder这是最常见的imo场景。
暴民埃里克(Erik the Outgolfer)'17年

为什么要下票?
dzaima

4

的Javascript,232个 230 228 226字节

(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}+`
  • @Stephen S,-2字节-使用默认功能参数
  • -2字节归功于OP-替换了一些空格
  • @Shaggy -2字节-解构字母字符串

演示版


最后一行丢失。此外,提交内容和摘录有所不同;例如,提交中缺少“水浸”。
毛茸茸的

@Shaggy答案已更新-感谢您的关注
Weedoze

-2通过移动字节sp为默认函数的参数,除去需要():函数体约S 小提琴
斯蒂芬

我不确定,但您不能更改${x?'leeching ':'seeding '}|为以下内容 ${x?'leeching':'seeding '} |吗?
LiefdeWen

@LiefdeWen你是对的!谢谢
Weedoze

3

PHP,179字节

没有输入

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字节

带输入

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);

在线尝试!


从第一个版本保存9个字节:++++$x&1(-2)中删除,$y=++$x%4|$z>9?"":++$z."0%"用作第二个printf参数(-9),并$z:10(+2)之前插入
Titus

2

Python 3,255个字节

我确信这可以打高尔夫,很快就会更新:

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")

在线尝试!


而不是leeching |and seeding |,您不能将其更改为leechingand seeding +" |"吗?
LiefdeWen

@LiefdeWen恐怕还要再增加8个字节...
Xcoder先生,17年

来吧,“即将更新”?反正246个字节清单图示和和/或
user202729'4

另外,//2*10is *510-(z-96)//2just 58-z//2
user202729'4


2

的Java(OpenJDK的8) 244 229 228 227 226个 224 222 218 217字节

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个字节,感谢@KevinCruijssen!


leechingseeding右对齐。
LiefdeWen

哇,快点评论!我刚看完帖子,就看到它了:p
OlivierGrégoire17年

很抱歉给您带来麻烦,我很高兴看到可读的商品
LiefdeWen

讨厌吗 不,您不是:)
OlivierGrégoire17年

1
Dangit ..当我修复并在答案中添加解释时,您真不敢相信。.我可能会再加上34个字节。.我看到了一些相似之处,但是巧妙地使用了.formatand和0%+1!顺便说一句,您可以从头开始,进一步解决问题s=z,例如: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
Kevin Cruijssen

2

Python 2中172个 170 162字节

-8字节感谢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])

在线尝试!


162,然后通过崩溃退出:tio.run/…–
Lynn

1

Braingolf673个 655字节

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$_!&@;

在线尝试!

我之前已经说过,我再说一遍:Braingolf在ASCII艺术方面很烂。

至少这只是实际对输出进行硬编码所需要的字节的1/3


1

V,107字节

¬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#

1

Japt,121字节

;'++(-p10 +'+ ³
1
U+R+C£W=Yv ªY>20?10:Y¥1?1:V±1"|{X}.exe {4î hW>9?S:W+"0%"}|{10î h'#pW}|{10î hW<10?`äƒÊA`:`Ð:ˆg`}|"+R+U+R

在线尝试!


1

Japt,98字节

;27Æ4î+ ¬q-pU=10ÃíC¬£'|²¬q[X+".exe {W=Yu ©°T<U©T*U ?W+'%:P}"'#pW/UªU `äÊA Ð:g`¸g!W]m!hUî)q|})c ·

在最新的版本,由于该食堂的错误不工作4î+q-p10q|,但它确实在工作的承诺f619c52在线测试!


1

T-SQL,238个字节

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+'+'

程序解决方案,格式为:

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 + '+'

循环中的所有内容(直到SET为止)都是同一PRINT语句的一部分,包括第一个字符串文字内的换行符。

我正在研究基于集合的解决方案(创建并填充表,然后从中进行SELECT),但是我不确定它是否会更小。


1

爪哇8,271个 263 262字节

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;}

所有这些麻烦什么都没有。. >>> ;)
@OliverGrégoire的 Java简短回答。)

说明:

在这里尝试。

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

在循环中使用a char代替int。它允许您以后不进行投射。t可以初始化,然后再初始化为零+=。它应该更短。
奥利维尔·格雷戈尔(OlivierGrégoire),

@OlivierGrégoire实际上长2个字节。int(char)t=...;VS char{t=1;t*=...;}。除非我缺少任何东西。
Kevin Cruijssen

不,您什么都不丢失,那是我的主意。我没有考虑到您的代码的其他部分。
奥利维尔·格雷戈尔(OlivierGrégoire),

1

普通TeX,306个字节

\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

1

05AB1E,120个字节

AS".exe"«'A17×S9L‚ζJJðK€H©T*т%εD0Q_i'%«ëð3×}}‚ζεðýð«}®'#×T®-úí"leeching  seeding   "Tô®TQè)ζ'|ýε'|.ø}õ.ø'-T∍'+«3×'+ì¶.øý

在线尝试!


这里有太多打高尔夫球的方法,当我低于90个字节时,会发布说明。


1

Stax53 68 64 字节

â"{≤╞c~£ÿτδ¬│∙}Dgoô₧»öÖ#9▌ó♂i◘ÿkùâGCå`è╙/♠Gδb,φW0EqΔ┘δth½àJZ¿l╦#

运行并调试

拆开包装后,它看起来像这样。

'+'-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

请注意,如果您使用“高尔夫”按钮从扩展解决方案中删除空格和注释,则会错误地使变成两倍}。如果删除多余的字符,它将继续正常工作。


1

C(gcc)217211字节

-6字节,感谢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);}

在线尝试!


0

/// 264字节

/~/\/\///!/---~@/!!!-~$/@+@+@~</+
|~>/|
+~(/###~*/  ~}/|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{>$+

在线尝试!

通过定义一堆替换项并使用它们来替换多个字符来工作。


0

Mathematica,274个字节

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}]

0

木炭154个149 143 130 103字节

A⁵δFβ«F³«+χ»+⸿A∨﹪δ²›δ⁹⁵θ|ι.exe⎇θ… ⁵⁺⁺ δ% ⁰|⎇θ…#χ⁺…#∕δχ… ⁻χ∕δχ⎇θ|seeding   |⸿↧|leeching  |⸿A⁺⁵δδ»F³«+χ»+

在线尝试!(链接到详细版本。)

  • 尼尔(Neil)熟练的木炭加工技术节省了27个字节。

您可以使用以下方法节省整个字节的负载\\r在线尝试!。请注意,我插入了虚拟操作,因为没有任何分隔符。
尼尔

@Neil确实,成功的打印似乎比对块求和并打印整个字符串要短。更不用说\r诀窍了,我不知道。
查理

0

泡泡糖,150个字节

00000000: e007 3d00 8c5d 0015 8b71 ec14 6414 8031  ..=..]...q..d..1
00000010: 7fc3 2b24 3568 ca81 7ab5 363e c3b7 f500  ..+$5h..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                           ......

在线尝试!


0

Perl6,225 219

my&f={say ("+"~"-"x 10)x 3~"+"};my&g={f;my$b=$^c>9??"   "!!$c*10~"%";say "|$^a.exe $b |{'#'x$c}{' 'x(10-$c)}|$^d  |"};my \s="seeding ";for 1..9 {g chr(95+2*$_),10,s;g chr(96+2*$_),$_,"leeching"};g $_,10,s for "s".."z";f

0

Lua,380个字节

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")))

用于gsub创建行分隔符和种子行。l生成水浸行。重命名gsubrep保存更多字节。


0

Jstx,126 个字节

►-○EO.♥/(:►+:1►+;+₧D0%4►|22♫♥φézï2♂bdfhjlnpr♀*U!↑)☺:♣<!,♂% |♀:2&₧#=-₧#/')▬►#◙')§► ◙21♫♠~√╫WσΓÇ2◙↓♫♥¿Ç~√₧#/►#:1♫♣~√▐┬╞¿:2◙►|41%

在线尝试!

说明

►-          # 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.

我相信这可以大大缩短。



0

帕斯卡(FPC) 294个 286 266 263字节

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.

在线尝试!

所以...我最终以换行符开头和结尾:D


0

PowerShell中224个 210 181 174 169 160字节

$l=("+"+"-"*10)*3+"+
"
0..25|%{"$l|$([char](97+$_)).exe "+("    |$("#"*10)|seeding ",("$(++$c/2)0% |{0,-10}|leeching"-f("#"*($c/2))))[$_%2-and$_-lt18]+"  |"}
$l

在线尝试!

现在减少了64个字节

一些巧妙的技巧:组合大量“ $(stuff)”以节省很多钱。我们只需要使$ _%2 = 1的奇数,因此不需要-eq。现在使用列表索引而不是if-else来节省5个字节。也摆脱了另一个字节的`n。我无法获得“ $ c`0%”来分隔var和零,因此当前路由比将两个字符串粘合在一起要短1个字节。现在使用-f格式。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.