Arte ASCII per l'interfaccia utente torrent


30

Problema

Ricreare l'interfaccia utente da un programma torrent

Dato nessun input, produrre quanto segue:

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

i progressi per i programmi sono:

b=10% d=20% f=30% h=40% j=50% l=60% n=70% p=80% r=90%

la quantità di #'s per i programmi di sanguisuga èprogress/10

gli altri sono tutti seedingcon barre di avanzamento complete.

Regole

  • Sono consentite nuove e principali linee guida.
  • Spazi iniziali e finali consentiti purché non modifichino la forma dell'output.
  • stdout e funzioni consentite per l'output.
  • Il codice più corto in byte vince

5
Sai che il download .exedai torrent non è la cosa più brillante da fare, eh?
— RobAu,

14
@RobAu come altrimenti avrei f.exepotuto trovare una copia di esso da nessun'altra parte.
— Liefde:

9
f.exeviene fornito con f_readme.txt"Esegui come amministratore". Sembra giusto.
— Magic Octopus Urn,

@RobAu Non lo sapevo, scarico regolarmente le distribuzioni Linux, che contengono eseguibili inclusi alcuni che installano bootloader, con torrent!
— Pascal Cuoq

Risposte:


5

Carbone di legna, 98 85 83 byte

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

Pensavo che copiare un modello mi avrebbe risparmiato un sacco di codice ma tutto sembra sommarsi in qualche modo, anche se sono riuscito a salvare 13 byte usando un singolo ciclo per correggere le 9 righe di sanguisuga. Spiegazione:

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

(Nota a margine: sembra che abbia scoperto un bug in Charcoal; |è un personaggio ASCII, ma è anche considerato una freccia ai fini di Multiprint, quindi non puoi Multiprint.)


Non un bug, puoi scappare se vuoi
— solo ASCII il

@ Solo ASCII Ah giusto, purtroppo il deverbosificatore non lo sa.
— Neil,

Oh vero, grazie per avermelo ricordato
— solo ASCII il

12

Perl 5 , 130 byte

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

Provalo online!

Mi aspetto che ci siano pochi byte che possono essere giocati a golf, ma sono rimasto senza ispirazione.

Brevi spiegazioni:
$econtiene la linea di separazione ( +----------+----------+----------+); la sua costruzione è semplice ( ("+"."-"x10)x3 ."+\n").
Quindi, giro i caratteri da aa z:
Ogni volta, stampa "|$_.exe%4s |%-10s|%-9s |\n$e; questo è uno standard printfcon segnaposto per stringhe ( %s) e stringhe con riempimento a sinistra ( %-9s).
se $|--&&$@++<9è vero ( $|è una variabile speciale che contiene 0 o 1 e decrementandone attiva o disattiva il suo valore), la percentuale non è del 100% e i tre valori nella stampa sono "$@0%","#"x$@,leeching( $@0%è in realtà solo $@ . "0" . "%"- ricorda che è $@stato incrementato in precedenza) , altrimenti, i tre valori sono "","#"x10,seeding).


6

Python 2 , 182 177 byte

Grazie a @officialaimm per la rasatura di 5 byte modificando il formato della condizione.

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

Provalo online!



1
Bello! L'ho visto un paio di volte ma non ho pensato di usarlo in questo caso. Posso aggiornare la mia risposta con la tua soluzione?
— Fedone,

Certo, puoi aggiornarlo. ;)
— officialaimm,


6

SOGL V0.12 , 90 89 88 byte

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

Provalo qui!

Spiegazione:

ē                                 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

Battiti SOGL .... Carbone ?!
— Mr. Xcoder,

1
@ Mr.Xcoder È lo scenario imo più comune.
— Erik the Outgolfer

Perché il downvote?
— dzaima,

4

Javascript, 232 230 228 226 byte

(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 byte grazie a @Stephen S - Utilizzo dei parametri di funzione predefiniti
  • -2 byte grazie a OP - Sostituzione di alcuni spazi
  • -2 byte grazie a @Shaggy - stringa di alfabeto distruttiva

dimostrazione


Manca l'ultima riga. Inoltre, la presentazione e lo snippet differiscono; "Leeching" non è presente nell'invio, ad esempio.
— Shaggy,

@Shaggy Risposta aggiornata - Grazie per il seguito
— Weedoze,

-2 byte spostando se pripristinando i parametri di funzione predefiniti, eliminando la necessità di ()s attorno al corpo della funzione: Fiddle
— Stephen,

Non sono sicuro ma non è possibile modificare ${x?'leeching ':'seeding '}|quanto segue ${x?'leeching':'seeding '} |:?
— Liefde:

@LiefdeWen Hai ragione! Grazie
— Weedoze,

3

PHP , 179 byte

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

Provalo online!

PHP , 176 byte

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

Provalo online!


Salva 9 byte dalla prima versione: rimuovi ++da ++$x&1(-2), utilizza $y=++$x%4|$z>9?"":++$z."0%"come secondo printfparametro (-9) e inserisci $zprima :10(+2)
— Tito

2

Python 3 , 255 byte

Sono sicuro che questo può essere giocato a golf, aggiornando presto:

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

Provalo online!


invece di leeching |e seeding |, non puoi cambiarlo in leechinge seeding +" |"?
— Liefde:

@LiefdeWen Temo che siano 8 byte in più ...
— Mr. Xcoder il

Dai, "aggiornamento presto"? Comunque 246 byte con elenco splat e e / o .
— user202729

Inoltre, //2*10è giusto *5ed 10-(z-96)//2è giusto 58-z//2.
— user202729

2

Rubino , 141 byte

puts s=(?++?-*10)*3+?+,(?a..?z).map{|c|["|#{c}.exe%4s |%-10s|%-9s |"%(c.ord%2>0||($.+=1)>9?["",?#*10,:seeding]:["#$.0%",?#*$.,:leeching]),s]}

Provalo online!


2

Java (OpenJDK 8) , 244 229 228 227 226 224 222 218 217 byte

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

Provalo online!

-2 byte grazie a @KevinCruijssen!


Il tuo leechinge seedingsono allineati a destra.
— Liefde:

Caspita, commento veloce! Ho appena visto dopo la pubblicazione e sono stato impegnato a risolverlo: p
— Olivier Grégoire il

Scusatemi per il fatto che sono un vero toccasana, mi emoziono solo nel vedere
— qualcosa di

Fastidio? No, non eri :)
— Olivier Grégoire il

1
Dangit .. Mentre stavo riparando e aggiungendo una spiegazione alla mia risposta mi hai battuto ad esso .. E 34 byte in meno potrei aggiungere .. Vedo alcune similitudini, ma uso intelligente di .formate 0%, +1! A proposito, puoi golfare la tua risposta ancora un po 'iniziando con s=z, invece, in questo modo: 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 byte )
— Kevin Cruijssen

2

Python 2 , 172 170 162 byte

-8 byte grazie a 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])

Provalo online!


162 ed esci via crash: tio.run/…
— Lynn,

1

Braingolf , 673 655 byte

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

Provalo online!

L'ho già detto e lo dirò di nuovo: Braingolf è cattivo nell'arte ASCII.

Almeno questo è solo 1/3 dei byte necessari per codificare effettivamente l'output


1

V , 107 byte

¬azÓ./|&.exeò
ddÎAµ |±°#|seeding³ |
ÙÒ-4ñr+11lñddç^/P
jp4G9ñ8|R00%3l10r llRleeching4jñV{10g
çä/WylWl@"r#

Provalo online!

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#

1

Japt , 121 byte

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

Provalo online!


1

Japt , 98 byte

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

Non funziona nella versione più recente a causa di un bug che scombina 4î+, q-p10e q|, ma funziona in commettonof619c52 . Provalo online!


1

T-SQL, 238 byte

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

Soluzione procedurale, formattata:

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

Tutto nel ciclo (fino al SET) fa parte della stessa istruzione PRINT, inclusa un'interruzione di riga all'interno della prima stringa letterale.

Sto lavorando a una soluzione basata su set (creare e popolare una tabella, quindi SELEZIONARE da essa), ma non sono sicuro che sarà più piccolo o meno.


1

Java 8, 271 263 262 byte

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

Tutti questi problemi per niente ..>.>;)
( Risposta Java più breve di @ OliverGrégoire .)

Spiegazione:

Provalo qui.

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

Usa un charinvece di un intnel ciclo. Ti consente di non lanciarlo in seguito. tpuò essere inizializzato e reinizializzato a zero e +=successivamente. Dovrebbe essere ancora più breve.
— Olivier Grégoire,

@ OlivierGrégoire In realtà è più lungo di 2 byte. int& (char)& t=...;vs char& {t=1;t*=...;}. A meno che non mi manchi qualcosa.
— Kevin Cruijssen,

No, non ti stai perdendo nulla, questa era la mia idea. Non ho preso in considerazione alcune altre parti del tuo codice.
— Olivier Grégoire,

1

TeX semplice, 306 byte

\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

Ungolf con alcune spiegazioni:

\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 byte

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

Provalo online!


C'è troppo da fare per giocare a golf qui, pubblicherò spiegazioni quando sarò sotto i 90 byte.


1

Stax , 53 68 64 byte

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

Esegui ed esegui il debug

Disimballato e ungolfed sembra così.

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

Si noti che se si utilizza il pulsante "Golf" per rimuovere spazi bianchi e commenti dalla soluzione espansa, si raddoppia erroneamente il }. Se rimuovi il carattere aggiuntivo, continua a funzionare correttamente.


1

C (gcc) , 217 211 byte

-6 byte grazie a 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);}

Provalo online!


0

/// , 264 byte

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

Provalo online!

Funziona definendo un gruppo di sostituzioni e usandole per sostituire più personaggi di quanti siano.


0

Mathematica, 274 byte

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

Carbone di legna , 154 149 143 130 103 byte

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

Provalo online! (Link alla versione dettagliata.)

  • Risparmio di 27 byte grazie alle tecniche di carbonizzazione di Neil.

Puoi salvare un intero carico di byte di byte usando \\r: Provalo online! . Nota che ho inserito operazioni fittizie perché non ottengo alcun separatore.
— Neil,

@Neil, in effetti, sembra che le stampe successive siano più brevi del riepilogo dei blocchi e della stampa dell'intera stringa. Per non parlare del \rtrucco, non lo sapevo.
— Charlie,

0

Bubblegum , 150 byte

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

Provalo online!


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 byte

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

Utilizza gsubper creare i divisori di riga e le righe di seeding. lgenera le file sanguisughe. Rinomina gsube repsalva più byte.


0

Jstx , 126 byte

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

Provalo online!

Spiegazione

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

Sono sicuro che questo può essere notevolmente più breve.


0

/// , 226 byte

/;/ "//:/$$$+//,/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!

Provalo online!

Un approccio un po 'più sofisticato alla definizione di sostituzioni. Provalo interattivamente qui!


0

Pascal (FPC) , 294 286 266 263 byte

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.

Provalo online!

Quindi ... ho finito con una nuova linea principale e finale: D


0

PowerShell , 224 210 181 174 169 160 byte

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

Provalo online!

Ora 64 byte meno terribili

Alcuni trucchi accurati: Combinare un sacco di "$ (roba)" per risparmiare sui genitori. Vogliamo solo numeri dispari che rendano $ _% 2 = 1, quindi non abbiamo bisogno di un -eq per questo. Ora utilizza l'indicizzazione degli elenchi anziché un if-else per salvare 5 byte. Elimina anche un `n per un altro byte. Non sono riuscito a ottenere "$ c`0%" per separare var e zero, quindi il percorso corrente era più corto di 1 byte rispetto all'incollaggio di due stringhe insieme. Ora con formattazione -f.

Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.