# 七斜线显示

99

``````/\
\ \
\/

\
\

/\
/
\/

/\
/\
/

\
\/\

/
\/\
/

/
\/\
\/

/\
\

/\
\/\
\/

/\
\/\
/
``````

``````    /\
/\
/\  /
\ \
/\ \/
/
\/
``````

``````           \
\/\
\
\
\
\
/\
\/\
/   /
\/\
\  /
\
``````

``````

\
\/\
\
\
\
\
/\
\/\
/   /
\/\
\  /
\

``````

41

Martijn 2015年

4

1
@ alexander-brett iirc的初衷是，但是，最近它已用于大多数代码可能将进行硬编码的问题。
Undergroundmonorail

Renae Lider 2015年

frederick

9

# CJam，77 71 70 69 63 62字节

``````r_,5*_Sa*a*\{~"÷ÐëúÜ¾¿ðÿþ"=i2bS"\/"4*W<+.*3/..e>2fm>2m>}/Wf%N*
``````

CJam解释器中在线尝试。

### 理念

`````` \/
\/\
/\
``````

``````247 208 235 250 220 190 191 240 255 254
``````

``````÷ÐëúÜ¾¿ðÿþ
``````

### 码

``````r_,      e# Read a token from STDIN and push the length of a copy.
5*_      e# Multiply the length by 5 and push a copy.
Sa*      e# Repeat the array [" "] that many times.
a*       e# Repeat the array [[" " ... " "]] that many times.
\{       e# For each character C in the input:
~      e#   Push eval(C), i.e., the digit the character represents.

"÷ÐëúÜ¾¿ðÿþ"

e#   Push the encodings of all 10 seven slash representations.

=      e#   Select the proper one.
i2b    e#   Push the resulting characters code point in base 2, i.e., its bits.
S      e#   Push " ".
"\/"4* e#   Push "\/\/\/\/".
+W<    e#   Concatenate and eliminate the last character.
.*     e#   Vectorized repetition.

e#   For the digit 5, e.g., we have [1 0 1 1 1 1 1 0] and  " \/\/\/\" on
e#   the stack, so .* yields [" " "" "/" "\" "/" "\" "/" ""].

3/     e#   Divide the representation into chunks of length 3, i.e., its lines.
..e>   e#   Compute the twofold vectorized maximum, as explained above.
2fm>   e#   Rotate each line to characters to the right.
2m>    e#   Rotate the lines two units down.
}/
Wf%      e# Reverse each line.
N*       e# Place linefeeds between them.
``````

TRiG 2015年

1
+1，但老实说，我希望CJam等人。会把这个坐下来：p
primo

@primo：我对Pyth和数学问题也有相同的看法。：P我参加聚会有点晚了，因为我被《重新排列单词》所困扰。直到今天早上您进行编辑后，我才想到了这个问题。

@Dennis的挑战似乎比以前快得多。我仍在研究两周前的

1

25

# Python 3中，189个183 174字节

``````s="a%sa"%input()
while s[1:]:b,a,c,d,e,f,g=[c*(ord(n)>>int(s[~(n>"Ͱ")],16)&1)or" "for c,n in zip("\/"*4,"ΟϭŅͭͱͼϻ")];S=len(s)*"  ";print(S+a+b,c+d+"\n"+S+e+f+g);*s,_=s
``````

``````s="a%sa"%input()
while s[1:]:
b,a,c,d,e,f,g=[c*(ord(n)>>int(s[~(n>"Ͱ")],16)&1)or" "
for c,n in zip("\/"*4,"ΟϭŅͭͱͼϻ")]
S=len(s)*"  "
print(S+a+b,c+d+"\n"+S+e+f+g)
*s,_=s
``````

## 说明

``````    ab               /\
efg               /\
ab cd            /\  /
efg              \ \
ab cd            /\ \/
efg               /
cd               \/
``````

``````bin(ord("ϻ")) = bin(1019) = "0b1111111011"
^^^^^^^^^^
9876543210
``````

19

# C，1098个345 323 319字节

``````a[]={100489,2056,98569,67849,2440,67969,100737,2057,100745,67977},i,j,k,n,m;char*c=" /\\";
#define f(q,r) for(q=0;q<(r);q++)
#define P(w) putchar(w)
#define Q(d,i,j) P(c[a[v[1][d]-48]>>(i*3+j)*2&3])
main(w,char**v){f(i,n=strlen(v[1]))f(k,(m=n-i-1)?2:3){f(j,m*2)P(32);f(w,3)Q(m,k,w);if(!k&&i)f(w,2)Q(m+1,2,w+1);P(10);}}
``````

``````#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int a[]={100489,2056,98569,67849,2440,67969,100737,2057,100745,67977};
char *c=" /\\";
#define f(q,r) for(q=0;q<(r);q++)
#define P(w) putchar(w)
#define Q(d,i,j) P(c[a[v[1][d]-48]>>(i*3+j)*2&3])
int main(int w, char **v)
{
int i,j,k,n,m;
f(i,n=strlen(v[1])) {
m=n-i-1;
f(k,m?2:3) {
f(j,m*2) P(32);
f(w,3) Q(m,k,w);
if (!k&&i) f(w,2) Q(m+1,2,w+1);
P(10);
}
}
}
``````

Alexey Burdin 2015年

15

Joshpbarron 2015年

Alex A.15年

14

# JavaScript中，192个178 167 162字节

``f=x=>{n=b="\n";for(k in x)for(i=0;i<8;)b+=("î\xA0Öô¸|~àþü".charCodeAt(x[k])>>i++&1?i%2?"/":"\\":" ")+(i%3?"":n+"  ".repeat(k));return b.split(n).reverse().join(n)}``

``````      /\
\
/\
/\
/\  /
/\
\  /
\
``````

``````f=x=>
{
n = b = "\n";

for (k in x)
for (i=0; i<8;)
b += ("î\xA0Öô¸|~àþü".charCodeAt(x[k]) >> i++ & 1? i%2? "/" : "\\" : " ") + (i%3? "" : n+"  ".repeat(k));

return b.split(n).reverse().join(n)
}
``````

`l`是一个包含10个单字节字符的数组，这些字符对应于每个数字的形状。例如，数字0由字符表示`î`

``````/\        11
\ \  -->  101  --> 11 101 110 = î
\/       011
``````

2
`==0``==1`之前确实是必要的`?`。int在js中不被认为是布尔值吗？@Regret
Alexey Burdin 2015年

1
@Regret：`"w\x05k/\x1D>~\x07\x7F?"`每个字符按位反转变为`"\xee\xa0\xd6\xf4\xb8|~\xe0\xfe\xfc"`，每个字符均可打印。这将再提供8个字节。虽然还不够……
Alexey Burdin 2015年

1

Scimonster 2015年

edc65 2015年

10

## Perl-103字节

``````#!perl -n
print\$i+\$%2?U^(u,\$i--%2?v9:z)[\$i<4+\$%2&vec\$_,4*\$-3-\$i,1]:\$/.!(\$i=\$--)
while\$+=2*y/0-9/wPkz\\>?p~/``````

``````#!perl -n
print\$i+\$^F%2?U^(u,\$i--%2?v9:z)[\$i<4+\$^F%2&vec\$_,4*\$^F-3-\$i,1]:\$/.!(\$i=\$^F--)
while\$^F+=2*y/0-9/wPkz\\>?p\177~/``````

shebang计为1，第二行不需要。输入来自标准输入。

``````\$ echo 0123 | perl seven-slash.pl

/\
/\
/\  /
/
\ \/
\
/\
\ \
\/

\$ echo 456789 | perl seven-slash.pl

/\
\/\
/\  /
\/\
/\ \/
\
/
\/\
/  \/
\/\
\  /
\/\``````

``````   /\           56
\/\          234
/\ \/   ->   56 01
\/\          234
\/           01``````

8

# C＃，360个355 331字节

``string p(string n){var l=new string[n.Length*2+1];var i=l.Length-1;for(;i>0;){var x=@"/\\ \\/ \  \  /\ / \//\ /\ / \\/\  / \/\ // \/\\//\  \  /\\/\\//\\/\ /".Substring((n[0]-48)*7,7);for(var j=i-3;j>=0;){l[j--]+="  ";}l[i--]+=" "+x[5]+x[6];l[i--]+=""+x[2]+x[3]+x[4];l[i]+=""+x[0]+x[1];n=n.Remove(0, 1);}return string.Join("\n",l);}``

``````          \
\/\
\
\
\
\
/\
\/\
/   /
\/\
\  /
\``````

``````string p(string n)
{
var l = new string[n.Length * 2 + 1];
var i = l.Length - 1;
for (; i > 0; )
{
var x = @"/\\ \\/ \  \  /\ / \//\ /\ / \\/\  / \/\ // \/\\//\  \  /\\/\\//\\/\ /".Substring((n[0] - 48) * 7, 7);

for (var j = i - 3; j >= 0; )
{
l[j--] += "  ";
}
l[i--] += " " + x[5] + x[6];
l[i--] += "" + x[2] + x[3] + x[4];
l[i] += "" + x[0] + x[1];

n = n.Remove(0, 1);
}

return string.Join("\n", l);
}``````

1

Shion

1

Kevin Cruijssen

4

## 蟒2，317 298 278 273.15

``````def f(s):
r=range;n=len(s)*2;l=[[' ']*-~n for x in r(-~n)]
for x in r(0,n,2):
for i,[d,y,c]in enumerate(zip('0112012','1021012',r'\\\\///')):l[n-2-x+int(y)][x+int(d)]=[' ',c][('%7s'%(bin(ord('}(7/jO_,\x7fo'[map(int,s)[x/2]])))[2:])[i]=='1']
for x in l:print''.join(x)``````

``````def f(s):
r=['1111101','0101000','0110111','0101111','1101010','1001111','1011111','0101100','1111111','1101111']
''.join(map(lambda x:chr(eval('0b'+x)),r))
n=len(s)*2
l=[[' ']*(n+1) for x in xrange(n+1)]
shifts=[(0,1,'\\'),(1,0,'\\'),(1,2,'\\'),(2,1,'\\'),(0,0,'/'),(1,1,'/'),(2,2,'/')]
for x in xrange(0,n,2):
y=n-2-x
for i,[dx,dy,c] in enumerate(shifts):
l[y+dy][x+dx]=c if r[map(int,s)[x/2]][i]=='1' else ' '
return '\n'.join(''.join(x) for x in l)``````

6

3

mbomb007

1
273.15字节意味着@AlexeyBurdin弄清楚了数字平台上的模拟计算。您为什么在世界上而不是在科学杂志上发表它？;-)
hBy2Py 2015年

1

Alexey Burdin 2015年

3

# KDB（Q），172136字节

``````{d:(9#1 2 0 2)*/:-9#'0b vs'427 136 403 409 184 313 315 392 443 441;
-1" /\\"{m+(c,/:y),c:(count[m:0 0,x,\:0 0]-3)#0}/[3 3#/:d"J"\$'(),x];}
``````

# 说明

1）创建`d`具有所有数字形状的地图。

2）用额外的零填充矩阵，并将它们加在一起。即“ 01”

``````0           0 0 0 2 0
0           0 0 0 0 2
1 2 0 0 0 + 0 0 0 0 0
2 0 2 0 0   0
0 2 1 0 0   0
``````

3）使用索引映射`" /\"`和打印`-1`

# 测试

``````q){d:(9#1 2 0 2)*/:-9#'0b vs'427 136 403 409 184 313 315 392 443 441;-1" /\\"{m+(c,/:y),c:(count[m:0 0,x,\:0 0]-3)#0}/[3 3#/:d"J"\$'(),x];}"0123456789"
/\
\/\
/\  /
\/\
/\ \/
\
/
\/\
/  \/
\/\
\  /
\/\
/\
/\
/\  /
/
\ \/
\
/\
\ \
\/
``````

1

hjk 2015年

1

hjk 2015年

1

WooiKent Lee

hjk 2015年

1

WooiKent Lee

2

# 点，122 +1 = 123字节

``````l:\$.(J"\/ "@^(A_TB3M"⮐䫶ヷ㄃䓳ⴷⴥㅕ⬿⭑")@_.2<>2Ma)z:2*#ap:sXz+2RLz+2Fi,5Fj,z{c:[4-ii]//2+j(pc@0c@1):(lij)}RVp
``````

UTF-8字符串中的字符具有以下代码点：`11152, 19190, 12535, 12547, 17651, 11575, 11557, 12629, 11071, 11089`

``````t:[120022001 222022202 122012021 122012201 220012202 120212201 120212001 122022202 120012001 120012201]
l:\$.({J"\/ "@^t@a.2<>2}Ma)
z:2*#a+2
p:sXzRLz
Fi,5
Fj,2*#a {
x:i//2+j
y:(4-i)//2+j
p@y@x:l@i@j
}
P RVp
``````

``````/.
\\
/.
\\
/.
``````

`````` .
/\.
\/\.
\/
``````

``````                            Ma   Map this lambda function to each character in input:
(A_TB3M"...")            Create list of the code points of each character in UTF-8
string, converted to base 3
@_          Index into that list using the input character
.2        Concatenate 2 to the end of the base-3 value (all of the
pre-skewed number grids end in 2, i.e. space)
^                         Split the number into a list of its digits
"\/ "@                          Index into this string with those digits, giving a list
of slashes & spaces
J                                Join the list together into a string
<>2     Group string two characters at a time
``````

2

## Brainfuck-719字节

``````>>>>+>+++>+++>>>>>+++[
>,+>++++[>++++<-]>[<<[-[->]]>[<]>-]<<[
>+>+>>+>+[<<<<]<+>>[+<]<[>]>+[[>>>]>>+[<<<<]>-]+<+>>>-[
<<+[>]>>+<<<+<+<--------[
<<-<<+[>]>+<<-<<-[
<<<+<-[>>]<-<-<<<-<----[
<<<->>>>+<-[
<<<+[>]>+<<+<-<-[
<<+<-<+[>>]<+<<<<+<-[
<<-[>]>>-<<<-<-<-[
<<<+<-[>>]<+<<<+<+<-[
<<<<+[>]<-<<-[
<<+[>]>>-<<<<-<-[
>>>>>+<-<<<+<-[
>>+<<-[
<<-<-[>]>+<<-<-<-[
<<+<+[>]<+<+<-[
>>-<-<-[
<<-[>]<+<++++[<-------->-]++<[
<<+[>]>>-<-<<<<-[
<<-<<->>>>-[
<<<<+[>]>+<<<<-[
<<+<<-[>>]<+<<<<<-[
>>>>-<<<-<-
]]]]]]]]]]]]]]]]]]]]]]>[>[[[<<<<]>+>>[>>>>>]<-]<]>>>+>>>>>>>+>]<
]<[-]<<<<<<<++<+++<+++[
[>]>>>>>>++++++++[<<++++>++++++>-]<-<<[-[<+>>.<-]]<<<<[
-[-[>+<-]>]>>>>>[.[>]]<<[<+>-]>>>[<<++[<+>--]>>-]
<<[->+<[<++>-]]<<<[<+>-]<<<<
]>>+>>>--[<+>---]<.>>[[-]<<]<
]
[Enter a number using ()-./0123456789abcdef and space, and hit return.
Daniel B Cristofani (cristofdathevanetdotcom)
http://www.hevanet.com/cristofd/brainfuck/]
``````

2

1

# Perl，270个字节

``````\$e="\\";\$g=" ";\$_=reverse<>;\$l=length;push@a,(119,18,107,91,30,93,125,19,127,95)[\$1]while/(.)/g;for(\$i=0;\$i<=\$l;\$i++){\$j=2*(\$l-\$i);\$b=\$a[\$i];\$c=\$i&&\$a[\$i-1];print" "x\$j,\$b&1?"/":\$g,\$b&2?\$e:\$g,\$g,\$c&32?\$e:\$g,\$c&64?"/":\$g,"
"," "x\$j,\$b&4?\$e:\$g,\$b&8?"/":\$g,\$b&16?\$e:\$g,"
"}
``````

1

# 的JavaScript（ES6），191 206

``````F=m=>(
a='    \\/  /\\/\\ /  /\\  \\\\ \\'.match(/.../g),
o=f='',r=' ',
[for(d of m)(
n=1e3+'¯B\x91ÿ\$ê\x86A\x87ë'.charCodeAt(d)+'', // here there are 3 valid characters tha the evil stackoverflow editor just erase off, so I had to put them as hex escape
o='\n'+f+' '+a[n[2]]+'\n'+r+a[n[1]]+o,
r=f+a[n[3]],
f+='  ')],
r+o
)

//TEST

go=_=>O.innerHTML =(v=I.value)+'\n'+F(v)

go()``````
``````<input id=I value='0123456789'><button onclick='go()'>-></button>
<pre id=O></pre>``````

0

# Java 8，341字节

``n->{int i=n.length*2,j=i+1,k=0,t;String l[]=new String[j],x;for(;j-->0;l[j]="");for(;i>0;l[i--]+=" "+x.substring(5,7),l[i--]+=x.substring(2,5),l[i]+=x.substring(0,2))for(x="/~~ ~~/ ~  ~  /~ / ~//~ /~ / ~~/~  / ~/~ // ~/~~//~  ~  /~~/~~//~~/~ /".replace('~','\\').substring(t=(n[k++]-48)*7,t+7),j=i-2;j-->0;)l[j]+="  ";return"".join("\n",l);}``

@Shion的C＃.NET答案的端口，因此请确保也对他进行投票

``````n->{                       // Method with character-array parameter and String return-type
int i=n.length*2,        //  Two times the length of the input array
j=i+1,               //  Index integer, starting at `i+1`
k=0,t;               //  Temp integers
String l[]=new String[j],//  String-array for the rows, default filled with `null`
x;                //  Temp-String
for(;j-->0;l[j]="");     //  Replace all `null` with empty Strings
for(;i>0                 //  Loop `i` downwards in the range [`n.length*2`, 0)
;                    //   After every iteration:
l[i--]+=            //    Append the row at index `i` with:
//    (and decrease `i` by 1 afterwards with `i--`)
" "               //     A space
+x.substring(5,7),//     And the 6th and 7th characters of temp-String `x`
l[i--]+=            //    Append the row at index `i` with:
//    (and decrease `i` by 1 afterwards with `i--`)
x.substring(2,5), //     The 3rd, 4th and 5th characters of temp-String `x`
l[i]+=              //    Append the row at index `i` with:
x.substring(0,2)) //     The 1st and 2nd characters of the temp-String `x`
for(x="/~~ ~~/ ~  ~  /~ / ~//~ /~ / ~~/~  / ~/~ // ~/~~//~  ~  /~~/~~//~~/~ /".replace('~','\\')
//   String containing all digit-parts
.substring(t=(n[k++]-48)*7,t+7),
//   and take the substring of 7 characters at index
//   `n[k]` as integer multiplied by 7
j=i-2;j-->0;)      //   Inner loop `j` in the range (`i`-2, 0]
l[j]+="  ";          //    And append the rows at index `j` with two spaces
return"".join("\n",l);}  //  Return the rows delimited with new-lines``````