输入您的输入


19

这有点类似于这个尘土飞扬的条目,但是我希望自己的旋转使它足够独特。找不到能阻止我发布此内容的任何东西,但是外面有很多大海。

无论如何!挑战:

您的代码收到一个字符串。它将其转换为相同字符串的ASCII艺术风格版本,但有一个问题。

输入转换

  • 唯一支持的字符是AZ和0-9
  • 小写字母转换为大写
  • 其他所有内容均被静默删除

人物画

  • 放大字体的每个“像素”都是从输入字符串中绘制的
  • 第n个像素等于输入字符串中的第n个字符。如果n大于输入字符串的长度,请绕回开头
  • 各个字母从左到右,从上到下绘制
  • 随后的字母从上一个字母的下一个位置开始获取其“像素字符”索引(例如,输入长度为10,如果第一个字母有9个像素,则第二个字母的第一个像素将使用第10个输入字符绘制,第二个像素将使用第一个输入字符绘制)
  • 每个字母都绘制在5x5的网格中,并用空格完全填充。您可以在此pastebin中找到要为您预渲染的字体,或者在本帖子中进一步介绍
  • 每个字母都画在同一行上,因此输出中的换行总数为4
  • 每个字母由2列空格分隔

字型

 000 
0  00
0 0 0
00  0
 000 

111  
  1  
  1  
  1  
11111

2222 
    2
 222 
2    
22222

3333 
    3
  333
    3
3333 

  44 
 4 4 
44444
   4 
   4 

55555
5    
5555 
    5
5555 

 6666
6    
6666 
6   6
 666 

77777
    7
   7 
  7  
 7   

 888 
8   8
 888 
8   8
 888 

 999 
9   9
 9999
    9
9999 

 AAA 
A   A
AAAAA
A   A
A   A

BBBB 
B   B
BBBB 
B   B
BBBB 

 CCCC
C    
C    
C    
 CCCC

DDDD 
D   D
D   D
D   D
DDDD 

EEEEE
E    
EEE  
E    
EEEEE

FFFFF
F    
FFF  
F    
F    

 GGGG
G    
G  GG
G   G
 GGGG

H   H
H   H
HHHHH
H   H
H   H

IIIII
  I  
  I  
  I  
IIIII

JJJJJ
  J  
  J  
  J  
JJ   

K   K
K  K 
KKK  
K  K 
K   K

L    
L    
L    
L    
LLLLL

M   M
MM MM
M M M
M   M
M   M

N   N
NN  N
N N N
N  NN
N   N

 OOO 
O   O
O   O
O   O
 OOO 

PPPP 
P   P
PPPP 
P    
P    

 QQ  
Q  Q 
Q QQ 
Q  Q 
 QQ Q

RRRR 
R   R
RRRR 
R  R 
R   R

 SSSS
S    
 SSS 
    S
SSSS 

TTTTT
  T  
  T  
  T  
  T  

U   U
U   U
U   U
U   U
 UUU 

V   V
V   V
 V V 
 V V 
  V  

W   W
W   W
W W W
WW WW
W   W

X   X
 X X 
  X  
 X X 
X   X

Y   Y
 Y Y 
  Y  
  Y  
  Y  

ZZZZZ
   Z 
  Z  
 Z   
ZZZZZ

是的,我知道4和Q很丑

一个例子

输入项

0123456789

输出量

 012   567    6789   0123     34   45678   9012  34567   234    567 
3  45    8        0      4   5 6   9      3          8  5   6  8   9
6 7 8    9     123     567  78901  0123   4567      9    789    0123
90  1    0    4          8     2       4  8   9    0    0   1      4
 234   12345  56789  9012      3   5678    012    1      234   5678 

另一个例子

输入项

a3 B'2

输出量

 A3B   B2A3   2A3B   2A3B 
2   A      B  2   A      2
3B2A3    2A3  3B2A    A3B 
B   2      B  3   B  2    
A   3  2A3B   2A3B   A3B2A

禁止出现标准漏洞。编码为高尔夫球,因此不会给出绿色勾号。


17
我建议保证输入将包含[A-Z\d]-我认为过滤无效字符不会增加任何挑战。
粗野的

3
@Shaggy也许。但是
出于



2
那三个领导空间呢?当然,您将不允许这样做!
魔术章鱼缸

Answers:


16

Python 2中413个 411 373 364 352 345字节

-1个字节感谢Kevin Cruijssen
-9个字节感谢Jo King
-1字节感谢Lynn

数据字符串包含不可打印的内容,下面是转义的版本。

k=list(filter(str.isalnum,input()))
q=range(5);o=['']*5;r=k*25;d=0
for c in'uM<LxSe#ye>El4NpD@$	gh>I,m]aB>e,]?kFLyglxV!%w832wGj%uT{Hr*K,*[P\n6.&ED#T}^DLI&p7f\d`*lG!FacG\rz?!A':d*=126;d+=ord(c)-1
for c in k:
 for i in q:
	for y in q+[999]*2:o[i]+=d>>int(c,36)*25+i*5+y&1and r.pop(0)or' '
print'\n'.join(o).upper()

在线尝试!

由于每个字符有25个像素,因此可以轻松地将其编码为25位。基数126 'uM\x04<L\x10x\x14Se#ye\x0f>El4NpD@$\tgh>\x1d\x10\x15I,\x0em]a\x0e\x03B>e\x15,\x0c]\x03?kFL\x01\x0byglxV!\x18\x16\x0c\x0b\x10\x0b%w832wGj%uT{Hr*K,*[P\n6.&ED#T\x0c}^\x1c\x0fD\x17LI&p7\x17f\\d`*\x01l\x1bG\x12!Fac\x05\x08\x0eG\rz?!\x1aA'编码所有字符,0由最低有效25位编码,1由接下来的25位Z编码,由25个最高有效位编码。单个字符按以下顺序编码:

00 01 02 03 04
05 06 07 08 09
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24

00是最低有效位,25最高有效位)

空格由零编码,非空格由一编码。范例

77777      11111
    7      00001
   7   =>  00010  => (0001000100010001000011111)
  7        00100
 7         01000

不打高尔夫球

k = list(filter(str.isalnum,input()))  # keep only alphanumeric characters of the input
o = ['']*5   # this list contains the output, initially 5 empty lines
r = k * 25   # make a copy of the input 25-times the length, these chars will be used for the pixels
data = 0
#  data encoded in base 126
b92d = 'uM<LxSe#ye>El4NpD@$	gh>I,m]aB>e,]?kFLyglxV!%w832wGj%uT{Hr*K,*[P\n6.&ED#T}^DLI&p7f\d`*lG!FacG\rz?!A'
for c in b92d:          # convert base 92 to base 10
  d*=126;d+=ord(c)-1

for c in k:             # iterate over the filtered input
  a_index = int(c, 36)  # the index of the current char in '0..9A..Z' / '0..9a..z'
  for i in range(5):    # for each row of the output
    for y in range(5)+[999]*2:  # for each pixel in the row, th two 999's are used for spaces
      is_set = data >> (a_index*25 + i*5 + y) & 1  # We shift the to the right to have ...
                                                   # the current pixels value at the LSB:
                                                   # 25 bits for each char that came before
                                                   # 5 bits for each previous row and 1 bit
                                                   # for every pixel in the same row
      o[i] += is_set and r.pop(0) or ' '           # If the current pixel is set, append ...
                                                   # ... a character from the input to the current row
print '\n'.join(o).upper()  # print the output

在线尝试!


字母应以两个空格隔开,因此+' '应为+' '。好的答案,无论如何,因此向我+1。
凯文·克鲁伊森

但是您确实需要一个.upper()地方,否则内部字母的结尾将变成小写字母
Jo King

@JoKing你是正确的,将其修复。
ovs

喜欢这个编码技巧。您是否选择了base 92,因为那是由可打印ascii组成的最大标准编码?你可以更高吗?我也用谷歌搜索,但无法在92号基础上完善信息-您有链接吗?
约拿(Jonah)

@Jonah没有像base 92编码这样的标准,这就是为什么我实现了自己的解码逻辑。只要您有足够的不同数字,就可以使用任何base >1
ovs

10

APL(Dyalog Unicode)的228个 225 224 214 字节

完整程序。提示stdin输入字符串。打印到标准输出。大约一半的代码只是解码编码的字母。

⍉↓(⍴t)⍴r\i⍴⍨+/r←,t←(⊂ai←(1(819⌶)⍞)∩a←⎕D,⎕A)⌷0(220⌶)¯1(219⌶)¯125+⎕AV_________________________________________________________________________________________________________________________________________________

__表示以下143字节的LZ4编码的引号:"⊥\u0004pæ€}€\\⊃⌿Æ€â<Å€∧€ÀÆ€Ð┬:Ëcü\u0000≥ðè⊤õ⍨¢∧·èý\u0005þÐÕ\u001EÐ :\u001Eè⌊×ßi[B⊂ɫoãà oéìÐ⍙⊃Ý∣à)≥èB⊃\u001B\u001F⊥ä{⌿⍨ G⍺\u001B⌿Æ\u001F∇x└îR`:└è→⊂\u0000ê∧⍒\u0003ɫqè$$ÛD⊥â∊\u001B\u001Eéu|\u001B@4A|⍪┌nàkááЀ€€€€€€"

在线尝试!

__ 143字节LZ4编码的引号中的字符串

⎕AV⍳ɩ在那ndices 托米奇V厄克托(字符集)

¯125+ 在其上加上-125(以获取带符号的8位整数)

¯1(219⌶) LZ4解压缩

0(220⌶) 反序列化为36层,5行,5列布尔数组

()⌷ 使用以下索引将其编入索引:

⎕A 大写一个 lphabet

⎕D, 前面加上d igits

a← 存储在a(对于一个 lphabet)

()∩ 以下各项的交集(删除无效输入):

 提示从stdin输入文本(控制台)

  1(819⌶) 折叠成大写(819看起来Big,1代表是大而不是小)

i← 存储在i(为 NPUT)

a⍳ɩ的是ndices在a

 附上(以索引表示,每个代表领先坐标)

t← 存储在t(对于 EXT)

, 拉平(拉平)

r← 存储在r(为- [R avelled)

+/ 总和(即绘画作品所需的字符数)

i⍴⍨周期性ř ESHAPE输入到该长度

r\ 扩大;在0s处插入空格,在1s处消耗字母

(…)⍴`重塑为以下形状:

⍴t 文字的形状

 将N×5×5阵列拆分为N×5的艺术线条矩阵

转置为5 x N的美术线条矩阵(这将对齐字符的相应线条)

默认情况下,APL用2个空格分隔嵌套数组的简单元素。


不完全的!每个字母之间必须有2个空格
Scoots

1
@Scoots OK,已修复。
亚当

@亚当有什么地方错了C和d
NGN

9

Python 2,428字节

s=filter(str.isalnum,input().upper());x=s
R=['']*5
for c in s:
 i=0;exec"n=int('RAAAOQQ2RBAQBQRRBDRRDCDDAQ8QBRDDDDDRXDDF0XX6CCDDCDCCCD00ECNLDDEDC0DDD66YYABH0A3RQQRQCDOOFR00OCHHDQIQA0D6H0000DXL0CXYXDDDCDCCDD00ECDFDCEEX0D6N6044AQARRQYQADQBQRCBDRKDRDDAC9DQ0A0DD0R'[i*36+ord(c)%55%45],36);R[i]+=bin(n+36*(n<30)<<2)[3:].replace(*'0 ').replace(*'1.');i+=1;"*5
 while'.'in`R`:R=eval(`R`.replace('.',x[0],1));x=x[1:]+s
print'\n'.join(R)

在线尝试!


字母编码如下:

每个唯一的部分(有23个)都将转换为二进制,并在前面添加1。然后将其转换为基数36。

  part      bin      1+bin     int     base36
'  ...' -> 00111 -> 100111 ->   39  ->   13

得出的以36为底的数字是:

[10,12,13,14,16,18,19,1A,1B,1C,1D,1E,1F,1H,1I,1K,1L,1N,1O,1Q,1R,X,Y]

首字母1被删除,因此我们只有一个字符:

[0,2,3,4,6,8,9,A,B,C,D,E,F,H,I,K,L,N,O,Q,R,X,Y]

A-Z0-9然后将每个字母()编码为这些新字符中的五个。

0 = ' ... ','.  ..','. . .','..  .',' ... ' -> A,F,H,L,A
1 = '...  ','  .  ','  .  ','  .  ','.....' -> O,0,0,0,R
etc.

分为五个列表:

'AOQQ2RBRAAAQBQRRBDRRDCDDAQ8QBRDDDDDR'
'F0XX6CCXDDDDCDCCCD00ECNLDDEDC0DDD66Y'
'H0A3RQQYABRQCDOOFR00OCHHDQIQA0D6H000'
'L0CXYXD0DXDDCDCCDD00ECDFDCEEX0D6N604'
'ARRQYQA4AQDQBQRCBDRKDRDDAC9DQ0A0DD0R'

为了将输入映射到这些列表中的索引,需要对序数进行修改:

'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ord(c) = [48-57, 65-90]
ord(c)%55%45 = [3-9, 0-2, 10-35]

由于序号不是0-35,而是略有混合,因此将5个列表重新排列并连接:

'RAAAOQQ2RBAQBQRRBDRRDCDDAQ8QBRDDDDDR'
'XDDF0XX6CCDDCDCCCD00ECNLDDEDC0DDD66Y'
'YABH0A3RQQRQCDOOFR00OCHHDQIQA0D6H000'
'0DXL0CXYXDDDCDCCDD00ECDFDCEEX0D6N604'
'4AQARRQYQADQBQRCBDRKDRDDAC9DQ0A0DD0R'
->
'RAAAOQQ2RBAQBQRRBDRRDCDDAQ8QBRDDDDDRXDDF0XX6CCDDCDCCCD00ECNLDDEDC0DDD66YYABH0A3RQQRQCDOOFR00OCHHDQIQA0D6H0000DXL0CXYXDDDCDCCDD00ECDFDCEEX0D6N6044AQARRQYQADQBQRCBDRKDRDDAC9DQ0A0DD0R'

对于输入中的每个字符,找到5个字母,并将其转换为ints(base36):

n=int('RAAA...D0R'[i*36+ord(c)%55%45],36)
                   i*36                    #get row i
                        ord(c)%55%45       #n -> 0..35
  int(                               ,36)  #convert to int

如果数字在下方3036则添加(1我们之前删除的缺失项)

n+36*(n<30)

然后将数字转换回二进制,并将0s和1s转换为.。在转换过程的最后添加两个空格。

bin(n+36*(n<30)<<2)[3:].replace(*'0 ').replace(*'1.')

    n+36*(n<30)                                       #add leading base36 '1'
               <<2                                    #add 2 0's to end
bin(              )                                   #convert to binary string
                   [3:]                               #remove '0b1' from front
                       .replace(*'0 ').replace(*'1.') #replace 0 and 1

例如。

C    base36    int     <<2       bin-str        str
3 ->   13   ->  39  ->  156 -> 0b10011100 -> '  ...  '

对于.结果中的每个字符,它将替换为输入中的下一个字符(由表示x

while'.'in`R`:R=eval(`R`.replace('.',x[0],1));x=x[1:]+s

真好!我可以麻烦您解释一下它的工作原理吗?目前,这在我看来是巫术。
酷航

@Scoots就可以了!:)
TF

3
感谢您的补充:)我在本站点的答案中看到的聪明才智永远不会打动我
酷航队

由于这些部分是5位,为什么不改用基数32?
尼尔

6

Java的8,917个 907字节

int i,l;String[]S;s->{String q=" ",t="",r[]={t,t,t,t,t};S=s.toUpperCase().replaceAll("[^A-Z0-9]",t).split(t);i=-1;l=S.length;for(String c:S){r[0]+=s("12357BDEFHIJKLMNPRTUVWXYZ",c)+s("012356789ABCDEFGIJOPQRSTZ",c)+s("0123456789ABCDEFGIJOPQRSTZ",c)+s("023456789ABCDEFGIJOPRSTZ",c)+s("567CEFGHIJKMNSTUVWXYZ",c)+q;r[1]+=s("05689ABCDEFGHKLMNOPQRSUVW",c)+s("4MNXY",c)+s("1IJT",c)+s("04KMQXYZ",c)+s("023789ABDHMNOPRUVW",c)+q;r[2]+=s("0456ABCDEFGHKLMNOPQRUW",c)+s("245689ABEFHKPRSV",c)+s("012345689ABEFHIJKMNPQRSTWXYZ",c)+s("23456789ABGHPQRSV",c)+s("0349ADGHMNOUW",c)+q;r[3]+=s("0268ABCDEFGHKLMNOPQRUW",c)+s("0VWXZ",c)+s("17IJTY",c)+s("4KNQRVWX",c)+s("035689ABDGHMNOSUW",c)+q;r[4]+=s("12359ABDEFHIJKLMNPRSWXZ",c)+s("012356789BCDEGIJLOQSUZ",c)+s("01235689BCDEGILOQSTUVYZ",c)+s("012345689BCDEGILOSUZ",c)+s("12ACEGHIKLMNQRWXZ",c)+q;}return"".join("\n",r);}String s(String...s){return s[0].contains(s[1])?S[++i%l]:" ";}

从这里开始打高尔夫球,希望至少使当前字节数减半。

在线尝试。

说明:

int i,                         // Index-integer on class-level
    l;                         // Length-integer on class-level
String[]S;                     // String-array of characters on class-level

s->{                           // Method with String as both parameter and return-type
  String q="  ",               //  Temp String containing two spaces to reduce bytes
         t="",                 //  Temp Empty String to reduce bytes
         r[]={t,t,t,t,t};      //  Start with five empty rows
  S=s.toUpperCase()            //  Transform the input-String to uppercase
     .replaceAll("[^A-Z0-9]",t)//  Remove all non alphanumeric characters
     .split(t);                //  And transform it into a String-array of characters
  i=-1;                        //  Set the index-integer on -1 to start with
  l=S.length;                  //  Set the length of the modified input
  for(String c:S){             //  Loop over the characters of the modified input:
    r[0]+=                     //   Append to the first row:
          s("12357BDEFHIJKLMNPRTUVWXYZ",c)      // The first pixel
          +s("012356789ABCDEFGIJOPQRSTZ",c)     // The second pixel
          +s("0123456789ABCDEFGIJOPQRSTZ",c)    // The third pixel
          +s("023456789ABCDEFGIJOPRSTZ",c)      // The fourth pixel
          +s("567CEFGHIJKMNSTUVWXYZ",c)         // The fifth pixel
          +q;                                   // Two trailing spaces
    r[1]+=                     //   Append to the second row:
          s("05689ABCDEFGHKLMNOPQRSUVW",c)      // The first pixel
          +s("4MNXY",c)                         // The second pixel
          +s("1IJT",c)                          // The third pixel
          +s("04KMQXYZ",c)                      // The fourth pixel
          +s("023789ABDHMNOPRUVW",c)            // The fifth pixel
          +q;                                   // Two trailing spaces
    r[2]+=                     //   Append to the third row:
          s("0456ABCDEFGHKLMNOPQRUW",c)         // The first pixel
          +s("245689ABEFHKPRSV",c)              // The second pixel
          +s("012345689ABEFHIJKMNPQRSTWXYZ",c)  // The third pixel
          +s("23456789ABGHPQRSV",c)             // The fourth pixel
          +s("0349ADGHMNOUW",c)                 // The fifth pixel
          +q;                                   // Two trailing spaces
    r[3]+=                     //   Append to the fourth row:
          s("0268ABCDEFGHKLMNOPQRUW",c)         // The first pixel
          +s("0VWXZ",c)                         // The second pixel
          +s("17IJTY",c)                        // The third pixel
          +s("4KNQRVWX",c)                      // The fourth pixel
          +s("035689ABDGHMNOSUW",c)             // The fifth pixel
          +q;                                   // Two trailing spaces
    r[4]+=                     //   Append to the fifth row:
          s("12359ABDEFHIJKLMNPRSWXZ",c)        // The first pixel
          +s("012356789BCDEGIJLOQSUZ",c)        // The second pixel
          +s("01235689BCDEGILOQSTUVYZ",c)       // The third pixel
          +s("012345689BCDEGILOSUZ",c)          // The fourth pixel
          +s("12ACEGHIKLMNQRWXZ",c)             // The fifth pixel
          +q;}                                  // Two trailing spaces
  return"".join("\n",r);}      //  Return the rows joined with new-lines

//  Separated method with String-varargs parameter and String return-type
String s(String...s){          
  return s[0].contains(s[1])?  //  If the String contains the character-String:
                               //   Increase `i` by 1 first with `++i`
    S[++i%l]                   //   Then return the i'th character of the modified input
                               //   with wraparound by using modulo-`l`
   :                           //  Else:
    " ";}                      //   Return a space

您似乎没有一个完整的示例。类字段,方法和lambda。我花了点时间为它+1,但是这里的方式似乎有点无效。
奥利维尔·格雷戈尔

@OlivierGrégoire嗯,我认为允许类级别的字段,只要您不将它们设置为类级别(该函数需要运行多次,而无需重置任何内容即可)。这就是为什么我i=-1内部有lambda。但是也许我不正确,根据元数据是不允许的吗?编辑:类似的事情经常在C答案中完成。
凯文·克鲁伊森

我不知道。这就是为什么我使用“似乎”一词的原因。但这将是将原始值实例化为其默认值的派生方式,对许多高尔夫球答案都有重大影响。例如:int i;f->{for(;i++<10;)print(i);}比短1个字节f->{for(int i=0;i++<10;)print(i);}
奥利维尔·格雷戈尔

@OlivierGrégoire这就是为什么我说i=-1lambda函数内部的原因。如果您两次运行同一个Lambda,则您的示例将不起作用,而我的示例则无法运行,这是此处的关键区别。int i;f->{for(i=0;i++<10;)print(i);}例如将被允许(尽管不是真的很短)。
凯文·克鲁伊森

5

Japt v2.0a0 -R213 211 210 209 206 193 191 190个字节

每行上都包含一个前导空格。

uf \ w
£`...`ò4gXn36)nLõd)¤r0Sr1 @ gT°Ãò5n)ù6Ãym¸

试试看测试所有字符(多余的字节是由于TIO尚不支持Japt v2)


说明

查找表

字符串中每4个字符的组(...此处表示是为了节省空间,因为它包含一堆不可打印的字符)是每个字符的二进制表示形式(0对于空格,1对于字符),其中的换行符已删除并转换为base-100。

ZZZZZ -> 11111
   Z  -> 00010
  Z   -> 00100 -> 1111100010001000100011111 -> 32575775 -> !::L
 Z    -> 01000
ZZZZZ -> 11111

代码

                                                :Implicit input of string U
u                                               :Uppercase
  f                                             :Get the array of characters matching
   \w                                           : /[a-z0-9]/gi
\n                                              :Reassign to U
£                                               :Map each character as X
 `...`                                          :  The string described above
      ò4                                        :  Split into strings of length 4
          Xn36                                  :  Convert X from base-36 to decimal
         g    )                                 :  Get the element in the array at that index
                Lõ                              :  Range [1,100]
                  d                             :  Get characters at those codepoints
               n   )                            :  Convert from that base to decimal
                    ¤                           :  Convert to binary
                     r0S                        :  Replace all 0s with spaces
                         r1                     :  Replace all 1s
                           @                    :  By passing each match through a function
                             T°                 :    Postfix increment T (initially 0)
                            g                   :    Get the character in U at that index (Yay, index wrapping!)
                               Ã                :  End replacement
                                ò5n)            :  Split into strings of length 5, weighted towards the end
                                    ù6          :  Left pad each with spaces to length 6
                                      Ã         :End mapping
                                       y        :Transpose
                                         m      :Map
                                          ¸     :  Join with spaces
                                                :Implicitly join with newlines and output

4

红宝石,366字节

->s{s.tr!('^0-9A-Za-z','');b=([s]*s.size).map(&:chars);%w(esuu6vfveeeufuvvfhvvhghheucufvhhhhhv j411agg1hhhhghgggh44igrphhihg4hhhaa2 l4e7vuu2efvughssjv44sgllhumue4hal444 p4g121h4h1hhghgghh44ighjhgii14hara48 evvu2ue8euhufuvgfhvohvhhegdhu4e4hh4v).map{|x|w=t='';s.chars{|c|c=~/\w/&&w+="%5b  "%x[c.to_i 36].to_i(36)};w.size.times{|i|t+=w[i]>?0?b[i/7].rotate![-1]:' '};t}}

在线尝试!

这可以打很多次,但是现在我已经没有时间和想法了。要使其正常工作,这比我最初想的要难。

怎么运行的:

理解起来并不难,我将通过一个示例来说明字母的编码方式。每个字符的每一行都转换为二进制,然后转换为base-36。

 AAA   -> 01110 -> E
A   A  -> 10001 -> H
AAAAA  -> 11111 -> V
A   A  -> 10001 -> H
A   A  -> 10001 -> H

第一步是从输入字符串中剥离所有非字母数字字符。

然后,我为最终渲染生成一个查找表,因为我要逐行打印。

之后,在字母行上进行迭代,创建字母的二进制模式。

最后,我将0替换为空格,将1替换为查询表中的字符。

随意打高尔夫球,我知道这可能会短20-30字节(使用gsub代替tr,依此类推),但是我现在不感兴趣,除非我可以使字母表表大大缩小。


4

木炭172个 164字节

≔⁺⭆χιαα≔Φ↥S№αιθFθ«E⁵⭆§⪪”)∧%"<⁰ETV´el⟧2[◧À&η²p.±‹§K×GR←∨�X¶⌈hF)ξυ9DUuqε↘Z)s⎚H⊙←<¿.&]~b≧✂⪪XïJ61%ZWm/ειK⮌λ﹪▷(σΠNc←º✳Fb⌕⊘¹ÞEpM&➙δl◨α↑j≕ςL¡ρG⁰/y”⁵⁺κ×⁵⌕αι⎇Iμ§θ⊖L⊞Oυω M⁷±⁵

在线尝试!链接是详细版本的代码。说明:

≔⁺⭆χιαα

将数字前缀为预定义的大写字母。

≔Φ↥S№αιθ

输入为大写并过滤掉所有不支持的字符。

Fθ«

循环其余字符。

E⁵

循环遍历每一行,将每个结果隐式打印在自己的行上。

⭆§⪪”...”⁵⁺κ×⁵⌕αι

压缩的字符串是@ovs的大整数常量,转换为二进制并取反。然后将其切成5个字符的180个子字符串,然后循环遍历当前字符和行的相关子字符串。

⎇Iμ§θ⊖L⊞Oυω 

如果该位置1,则循环打印已过滤输入的下一个字符,否则打印一个空格。

M⁷±⁵

将光标置于准备打印下一个字符的位置。


3

Perl 5的-nlaF/[^A-Za-z0-9]+|/247个字节

@l{0..9,A..Z}=unpack("b*",q&....!.?.......G...../.......\....c|...C......'..N.>..c.1~B......I1..~.5.8k....^|!...}.......BH.1..."1..."*FE.....&)=~/.{25}/g;eval'$;[$j%5].=($l{+uc}=~/.{5}/g)[$j++%5]=~s/./$&?uc$F[$i++%@F]:$"/ger.$"x2;'x5for@F;say for@

在线尝试!


说明

首先,%l使用packed数据创建查找表。此数据是一个900位二进制字符串,每个字符都打包为25位二进制字符串(存储为113个字节-仅比木炭多1个字节!),与其他一些答案类似,因此A

 AAA 
A   A
AAAAA
A   A
A   A

其中,使用0用于空间和1用于A为:

01110
10001
11111
10001
10001

没有换行符是:

0111010001111111000110001

一旦查找被初始化,我们迭代在每个有效炭中@F(其中使用Perl的填充-a添加到每个列表的5种元素的utosplit选择)@;用于从查找阵列中的每一行,更换所有1s的uc$F[$i++%@F]其是$i第字符(@F取的长度的模数@F)转换为upper case,所有0s均$"默认为空格。一旦在每个索引@;中填充的每个字符@Fsay打印带有一个尾随换行符每一行。

注意:后面的字符串unpack包含不可打印的内容,这些不可打印的内容使用\xXX符号进行转义。验证247分


3

SOGL V0.12165个 164 163 字节

⁰CīøDs8↓3‛⁸⁷ω8<t↑\≈⅓dPb¦l═│ƹč<⁷i3ζ°@Ο≠ΖηKπ⁴Φd←⅔Ωī$∞ΧΗf▼xƧqWƨ∑ģpc!ƨ@┐Γ<§5ΛMn«Ιq;⁾№╔1xdψBN≤⁴ζ8□\b╗³╤>↔²Μ±}H}≤╬bφIæ7“2─{rƧ- W}⁰∑M¼nEU{SUZ+;W:?ew;cF+C}X}⁰┌cŗā;{√┼@L*┼

在这里尝试!

说明:

...“                 big long number of the character data
    2─               convert to a base 2 string
      {r    }        for each number in it
        Ƨ- W           get it's index in "- ": space for 0, dash for 1
             ⁰∑      join up the results
               M¼n   split into groups of 25 - the letters
                  E  save that in variable E

U{                 }⁰ map over the input uppercased
  SUZ+                  push 1234567890 + the alphabet
      ;W                get the current characters index in that string
        :?       }      duplicate, if not 0 (aka if found)
          e               push the variable E
           w              get in it the duplicated number'th item
                            this leavesleaving the array below the item
            ;             get the array ontop
             cF+C         append the character to the array C
                  X     and remove the top item - either the duplicate or the array

┌             push "-"
 c            load the variable C
  ŗ           cycically replace "-" in maps result with the characters of C
   ā          push an empty array - the output
    ;{        for each item in the result of the replacement
      √         squareify it
       ┼        and append that to the output array
        @L*┼    top-to-bottom, left-to-right add 10 spaces to the array

2

的JavaScript(Node.js的)365个 347字节

@Scoots节省了1个字节

返回由5个字符串组成的数组。每行包含一个前导空格。

37将所有内容转换为大写并匹配[A-Z0-9]:-/ 会丢失36个字节

a=>(a=a.toUpperCase(s=[...'     ']).match(/[A-Z\d]/g)).map(x=c=>(g=n=>n<35&&g(n+1,s[n<25?n/5|0:n%5]+=Buffer("mJ*Z?<^#?.&+o@V+`L7ho=Jkm?`:Tm)Km?ZZo@p*#MmjoCZ[=('ZoC#;?-g[RZW[>.cJ#Mmm?<^;Vp5[#p*]?,iM#KAm$$:Mm?0*R[#;-46B#qC;o==*X$(km?0-XDc=$.Mm#%]=X$*-?1M[".slice(parseInt(c,36)*(i=v=4))).map(c=>v+=c%80*80**--i)|v>>n&n<25?a[++x]||a[x=0]:' '))(0))&&s

在线尝试!

字符编码

使用ASCII范围[35..114]将字符上下颠倒编码,并转换为偏移量为4的自定义基数80 。

3579直接映射到相应的ASCII字符,而值034映射到字符80114。这允许仅以ASCII码为模80进行解码。

例如,“ F”编码为"RZW["

....#     00001
....#     00001
..### --> 00111 --> 0000100001001110000111111 --[decimal]--> 1088575 --[-4]--> 1088571
....#     00001
#####     11111

floor(1088571 / 80**3)        = 2    --> (( 2 + 45) mod 80) + 35 = 82  --> 'R'
floor(1088571 / 80**2) mod 80 = 10   --> ((10 + 45) mod 80) + 35 = 90  --> 'Z'
floor(1088571 / 80)    mod 80 = 7    --> (( 7 + 45) mod 80) + 35 = 87  --> 'W'
1088571                mod 80 = 11   --> ((11 + 45) mod 80) + 35 = 91  --> '['

i = v = 4开始,通过执行以下操作将其解码回25位整数:

Buffer("RZW[").map(c => v += c % 80 * 80 ** --i)

在完整的代码中,我们实际上处理了编码流的无限制slice(),这意味着我们很可能迭代超过4次。这不是问题,因为所有i <0的迭代都只会影响结果的小数部分,无论如何,立即执行的按位运算都会忽略该结果。

在线尝试!


您可以toUpperCaseiRegEx中的标志替换吗?
粗野的

@Shaggy这会使输出中的小写字符保持不变,我认为这是不允许的。
Arnauld

啊,看来您是对的,我很想念。最好更新自己的解决方案!
粗野的

1
您可以通过匹配[A-Z\d]而不是保存一个字节[A-Z0-9]吗?
酷航

1

C(gcc)792690字节

#define S strlen
#define V v[1][i]
#define A putchar(32);
#define F(x)(((G(x,0)*92+G(x,1))*92+G(x,2))*92+G(x,3))*92+G(x,4))
#define G(x,y)(f[(x-(x<58?48:55))*5+y]-35)
i,j,l;main(c,v)char**v;{l=S(v[c=1]);char*x[l],t[l+1],*p=t,*f="$dKqK&>%Q3&R`ms&RYXg#gAB/&b_R/$n>Pw&]?vO$cbu+$ccG#$csC+&X7sS$n0w[&X+={&b^%s&b^$W$n3qS%(4\\_&^Bjg&^Bj/%(Pec$xx%S%+L`/%*jjw$cel7&X7oS$NWLO&X7u3$n.U+&^BhG%(')k%'|*/%(+:'%%UO;%%U=K&]`{+";*x=t;for(;i<l;i++){V>96?V-=32:V;(V>47)&(V<58)|(V>64)&(V<91)?*(p++)=V:V;}*p=0;for(;c<S(t);)x[c++]=((__builtin_popcount(F(t[c-1])+x[c-1]-t)%S(t))+t;for(c=6;--c;){for(i=0;i<S(t);i++){for(j=5,l=1<<c*5+3;j--;)if((l>>=1)&F(t[i]){putchar(*x[i]++);!*x[i]?x[i]=t:x;}else A A A}puts(p);}}

在线尝试!

设法将其压缩到800以下,并进行了一些可变的重用。选择将字体存储为ints 数组,尽管将其存储为一个长字符串似乎是一个吸引人的主意,但是该字体的许多8位块都不是一个很好的便捷ASCII字符,因此转义码已占用比int数组更多的字符。

编辑:毕竟是通过切换到字符串编码来获得700以下的信息-受到许多其他响应的启发,在这里,我使用(大多数)可打印ASCII字符将base-92表示形式拼凑在一起。该表示的确包含反斜杠,需要转义一个额外的斜杠,但这仅在字体中发生一次。

除此之外,没有太多花哨的内容-输入(由第一个命令行参数组成)被复制到堆栈数组中,减去字体中没有的字符,并用小写字母替换为小写字母大写版本,计算每个完整字母开头的“像素”字符(使用__builtin_popcount一个痛苦的长名称,但仍然比我认为的任何计数方法都要好),然后逐行打印。当然,编译器会在警告中输出程序长度的几倍。

为您的观看乐趣,下面进行了一些整理:

//The defines are listed here for reference. Some are replaced in the below code but I still use F() because it's long.
#define S strlen
#define V v[1][i]
#define A putchar(32);
#define F(x)(((G(x,0)*92+G(x,1))*92+G(x,2))*92+G(x,3))*92+G(x,4))  //How to lookup a font character given an input char x
#define G(x,y)(f[(x-(x<58?48:55))*5+y]-35)                         //Used for looking up the individual parts of a character font
i, j, l;                                           // Declaring some int variables for later use.
main(c,v) char**v; {                               // Declaring afterwards lets us have the int arg default without declaring it
  l = strlen(v[c=1]);                              // Using l as a local variable to shorten S(v[1]) and also giving c an initial value here where there was a spare 1, saving a character over writing the full c=1 init in a later for loop.
  char t[l+1], *p=t, *x[l];                        // Declaring char arrays and char*s and char* arrays. t is oversized if there are any invalid characters in the input, but that's not important for golfing.
  char *f="$dKqK&>%Q3&R`ms&RYXg#gAB/&b_R/$n>Pw&]?vO$cbu+$ccG#$csC+&X7sS$n0w[&X+={&b^%s&b^$W$n3qS%(4\\_&^Bjg&^Bj/%(Pec$xx%S%+L`/%*jjw$cel7&X7oS$NWLO&X7u3$n.U+&^BhG%(')k%'|*/%(+:'%%UO;%%U=K&]`{+";      // The font, encoded base-92 with 5 characters to a letter in the order 0123456789ABCDEF... etc.
  *x=t;                                            // The first character's "pixels" will start at the beginning of the valid input.
  for(; i<strlen(l); i++){                         // Speaking of which, now validate the input.
    v[1][i] > 96 ? v[1][i] -= 32 : v[1][i];        // Change lowercase characters to uppercase. If they aren't actually lowercase characters but have ascii value >96, they won't end up valid after this either and will be edited out on the next line. The false case does nothing, but since with the macro it is one character using the ternary operator saves a character over an if statement even though that case ends up redundant.
    (v[1][i]>47)&(v[1][i]<58)|(v[1][i]>64)&(v[1][i]<91)?*(p++)=v[1][i]:v[1][i];        // If the character is now either a numeral or an uppercase letter, set the next spot in the t array by way of the pointer p and then increment said pointer. 
  }
  *p=0;                                            // Add the null terminator to the t array, our validated input string.
  for(;c<strlen(t);) {                             // Now find out at what index each letter should start getting "pixels" from.
    x[c++] = ((__builtin_popcount(F(t[c-1])+x[c-1]-t)%strlen(t))+t;          // Use the builtin to get the number of on bits/pixels in the previous letter, then add that to the previous letter's starting pixel and take the modulus strlen() of the valid string.
  }
  for(c=6; --c;){                                  // Now start the actual printing. For each line...
    for(i=0; i<strlen(t); i++){                    // For each letter...
      for(j=5, l=1<<c*5+3; j--;) {                 // For each pixel of the 5 on this line...
        if((l>>=1) & F(t[i]) {                     // If it is on...
          putchar(*x[i]++);                        // Print it and increment the pixel-fetching pointer for this letter.
          !*x[i]?x[i]=t:x;                         // If said pointer hit the end of the valid input go back to the beginning.
        } else {
          putchar(32);                             // If it is an off pixel, print a space.
        }
      }
      putchar(32);                                 // After a letter, print two spaces.
      putchar(32);
    }
    puts(p);                                       // This is the cheapest way in character count I could come up with to output a newline. p currently points to the end of t, so it is an empty string and puts just adds a newline.
  }
}


1

Excel VBA,816字节

匿名VBE立即窗口功能,可接收范围输入[A1]并将其输出到控制台。

据我所知,这是使用base64压缩的第一个VBA答案。

For i=1To[Len(A1)]:c=Mid(UCase([A1]),i,1):y=y &IIf(c Like"[0-9A-Z]",c,""):Next:l=Len(y):Set d=New MSXML2.DOMDocument:Set d=d.createElement("b64"):d.DataType="bin.base64":d.Text="HxHxCSEqRkVUjLvGSJSK0cUYIyGEfB8cfFH66Ju0kkHoo3cxRhdnzTHGuuOHEMIouYyYEPI/IeTH+GN8ccIHIYf/Qw6/jzH6ByF8PvroY/zR+fCic9FFh4gI30UPnw8efiG+Mj6c4D90wX9CCHe5Tgc=":b=d.nodeTypedValue:For i=0To 112:k=Right("00000" &Evaluate("=Dec2Bin("&b(i)&")"),8)&k:Next:For i=1To 5:For j=1To l:c=UCase(Mid(y,j,1)):Z=c Like"[0-9]":s=s &IIf(c Like"[A-Z]",Mid(k,IIf(Z,1,25*(Asc(c)-55)+5*i),5)&" ",IIf(Z,Mid(k,25*(Asc(c)-48)+5*i,5)&" ","")):Next:s=Replace(Replace(s,0," "),1,"#") &vbLf:Next:Do:i=InStr(1+(g*l+h)*6+g,s,"#"):p=(p-e)Mod l:e=i<(g*l+h+1)*6+g:s=IIf(e,Left(s,i-1)&Replace(s,"#",Mid(y,p+1,1),i,1),s):g=g-(0=e):h=h-(g>4):g=g Mod 5:Loop While InStr(1,s,"#"):?s

注意:此答案取决于Microsoft XML, v3.0VBA参考

示例I / O

[A1]="'0123456789"
For i=1To[Len(A1)]:c=Mid(UCase([A1]),i,1):y=y &IIf(c Like"[0-9A-Z]",c,""):Next:l=Len(y):Set d=New MSXML2.DOMDocument:Set d=d.createElement("b64"):d.DataType="bin.base64":d.Text="HxHxCSEqRkVUjLvGSJSK0cUYIyGEfB8cfFH66Ju0kkHoo3cxRhdnzTHGuuOHEMIouYyYEPI/IeTH+GN8ccIHIYf/Qw6/jzH6ByF8PvroY/zR+fCic9FFh4gI30UPnw8efiG+Mj6c4D90wX9CCHe5Tgc=":b=d.nodeTypedValue:For i=0To 112:k=Right("00000" &Evaluate("=Dec2Bin("&b(i)&")"),8)&k:Next:For i=1To 5:For j=1To l:c=UCase(Mid(y,j,1)):Z=c Like"[0-9]":s=s &IIf(c Like"[A-Z]",Mid(k,IIf(Z,1,25*(Asc(c)-55)+5*i),5)&" ",IIf(Z,Mid(k,25*(Asc(c)-48)+5*i,5)&" ","")):Next:s=Replace(Replace(s,0," "),1,"#") &vbLf:Next:Do:i=InStr(1+(g*l+h)*6+g,s,"#"):p=(p-e)Mod l:e=i<(g*l+h+1)*6+g:s=IIf(e,Left(s,i-1)&Replace(s,"#",Mid(y,p+1,1),i,1),s):g=g-(0=e):h=h-(g>4):g=g Mod 5:Loop While i<InStrRev(s,"#"):?s
 012  567   6789  0123    34  45678  9012 34567  234   567  
3  45   8       0     4  5 6  9     3         8 5   6 8   9 
6 7 8   9    123    567 78901 0123  4567     9   789   0123 
90  1   0   4         8    2      4 8   9   0   0   1     4 
 234  12345 56789 9012     3  5678   012   1     234  5678

脱胎换骨和解释

此解决方案的主要部分将大字体存储为基本64字符串。这是通过首先将字体转换为二进制来完成的,其中1代表一个on像素,0代表关闭像素。例如,对于0,它表示为

      ###     01110
     #  ##    10011
0 -> # # # -> 10101 --> 0111010011101011100101110
     ##  #    11001
      ###     01110

通过这种方法,字母数字可以表示为

0: 0111010011101011100101110    1: 1110000100001000010011111
2: 1111000001011101000011111    3: 1111000001001110000111110
4: 0011001010111110001000010    5: 1111110000111100000111110
6: 0111110000111101000101110    7: 1111100001000100010001000
8: 0111010001011101000101110    9: 0111010001011110000111110
A: 0111010001111111000110001    B: 1111010001111101000111110
C: 0111110000100001000001111    D: 1111010001100011000111110
E: 1111110000111001000011111    F: 1111110000111001000010000
G: 0111110000100111000101111    H: 1000110001111111000110001
I: 1111100100001000010011111    J: 1111100100001000010011000
K: 1000110010111001001010001    L: 1000010000100001000011111
M: 1000111011101011000110001    N: 1000111001101011001110001
O: 0111010001100011000101110    P: 1111010001111101000010000
Q: 0110010010101101001001101    R: 1111010001111101001010001
S: 0111110000011100000111110    T: 1111100100001000010000100
U: 1000110001100011000101110    V: 1000110001010100101000100
W: 1000110001101011101110001    X: 1000101010001000101010001
Y: 1000101010001000010000100    Z: 1111100010001000100011111

将这些段连接起来并转换为MSXML base 64,呈现

HxHxCSEqRkVUjLvGSJSK0cUYIyGEfB8cfFH66Ju0kkHoo3cxRhdnzTHGuuOHEMIouYyYEPI/IeTH+GN8ccIHIYf/Qw6/jzH6ByF8PvroY/zR+fCic9FFh4gI30UPnw8efiG+Mj6c4D90wX9CCHe5Tgc=

下面的子例程将其取回,然后转换为二进制,并以此为参考,以此为基础逐行构建输出字符串,首先抓取每个字符的前5个像素,然后抓取第二行,依此类推,直到构造了字符串。

然后,该子例程遍历输出字符串,并用输入字符串中的字符替换“ on”像素。

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''
''  Embiggen Function
''
''  @Title  :   Embiggen
''  @Author :   Taylor Scott
''  @Date   :   15 June 2018
''  @Desc   :   Function that takes input, value, and outputs a string in which
''              value has been filtered to alphnumerics only, each char is then
''              scaled up to a 5x5 ASCII art, and each 'pixel' is replaced with
''              a char from value. Replacement occurs letter by letter, line by
''              line
''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function EMBIGGEN(ByVal value As String) As String

    Dim DOM         As New MSXML2.DOMDocument, _
        bytes()     As Byte

    Dim isNum       As Boolean, _
        found       As Boolean, _
        index       As Integer, _
        length      As Integer, _
        line        As Integer, _
        letter      As Integer, _
        pos         As Integer, _
        alphanum    As String, _
        char        As String, _
        filValue    As String, _
        outValue    As String

    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''
    ''  Filter input
    ''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    For letter = 1 To Len(value) Step 1             ''  Iterate Accross `Value`
        Let char = Mid$(UCase(value), letter, 1)    ''  Take the nth char
        ''  If the char is alphnumeric, append it to a filtered input string
        Let filValue = filValue & IIf(char Like "[0-9A-Z]", char, "")
    Next letter
    Let length = Len(filValue)                      ''  store length of filValue

    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''
    ''  Convert Constant from Base 64 to Byte Array
    ''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    With DOM.createElement("b64")           ''  Construct b64 DOM object
        Let .DataType = "bin.base64"        ''  define type of object`
        ''  Input constructed constant string shown above
        Let .Text = "HxHxCSEqRkVUjLvGSJSK0cUYIyGEfB8cfFH66Ju0kkHoo3cxRhdnz" & _
                     "THGuuOHEMIouYyYEPI/IeTH+GN8ccIHIYf/Qw6/jzH6ByF8PvroY/" & _
                     "zR+fCic9FFh4gI30UPnw8efiG+Mj6c4D90wX9CCHe5Tgc="
        Let bytes = .nodeTypedValue         ''  Pass resulting bytes to array
    End With

    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''
    ''  Convert Byte Array to Byte String
    ''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    For index = 0 To 112 Step 1
        '' convert each byte to binary, fill left with `0`s and prepend
        Let alphanum = _
            Right("00000" & Evaluate("=Dec2Bin(" & bytes(index) & ")"), 8) & _
            alphanum
    Next index

    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''
    ''  Construct Embiggened Binary String of Input Value
    ''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    For line = 1 To 5 Step 1                ''  iterate across lines
        For letter = 1 To length Step 1     ''  iterate across letters
            ''  take the corresponding letter from
            Let char = UCase(Mid(filValue, letter, 1))
            If char Like "[0-9]" Then       '' if it is a number,
                ''  Add the 5 bit corresponding to number at line
                Let outValue = outValue & _
                    Mid$(alphanum, 25 * Val(char) + 5 * line, 5) & " "
            ElseIf char Like "[A-Z]" Then   '' if it is a letter,
                ''  Add the 5 bits corresponding to letter at line
                Let outValue = outValue & _
                    Mid$(alphanum, 25 * (Asc(char) - 55) + 5 * line, 5) & " "
            End If
            Next letter
        Let outValue = outValue & IIf(line < 5, vbLf, "")
    Next line
    Let outValue = Replace(Replace(outValue, 0, " "), 1, "#")

    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''
    ''  Replace #s with Input Value
    ''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Let pos = 0                             ''  Reset position in filValue
    Let line = 0                            ''  Reset line index
    Let letter = 0                          ''  Reset letter index
    Do
        ''  Find the index of the first `#` starting at line and letter
        Let index = _
            InStr(1 + (line * length + letter) * 6 + line, outValue, "#")
        ''  Iterate position in filValue if a `#` is found in that letter & line
        Let pos = (pos - found) Mod length
        ''  check to see if found index is in the correct letter
        Let found = index < (line * length + letter + 1) * 6 + line
        ''  iff so, replace that # with letter in filValue corresponding to pos
        Let outValue = IIf(found, _
            Left(outValue, index - 1) & _
                Replace(outValue, "#", Mid(filValue, pos + 1, 1), index, 1), _
            outValue)
        ''  if not found, them iterate line
        Let line = line - (found = False)
        ''  iterate letter every five iterations of line
        Let letter = letter - (line > 4)
        ''  Ensure that line between 0 and 4 (inc)
        Let line = line Mod 5
    ''  Loop while there are '#'s in outValue
    Loop While InStr(1, outValue, "#")

    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''
    ''  Output
    ''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Let EMBIGGEN = outValue

    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''
    ''  Clean Up
    ''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Set DOM = Nothoing
End Function

1

K(ngn / k)230 231字节

(更改语言隐含符号后的+1个字节)

f:{{x,'"  ",/:y}/(#s;5;5)#@[(#c)#"";i;:;(#i:&c:,/(36 25#4_,/+2\a)s)#`c$b s:((b:(48+!10),65+!26)?x-32*(96<x)&x<123)^0N]}

在线尝试!

其中a是对字体进行编码的带引号的字符串文字。K将字符串视为字节序列,因此包含此类文字的程序是有效的,但不能在TIO上运行,因为其HTML格式试图将其解释为UTF-8并将其弄乱。

字节数计算如下:

  • TIO报告了119

  • -2用于命名功能 f:

  • -1(占位符) a

  • 2双引号 ""

  • 113表示字符串文字的长度,a其中不包含任何需要转义的字符

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.