| Bytes | Lang | Time | Link |
|---|---|---|---|
| 018 | Vyxal 3 | 250516T225522Z | Themooni |
| 021 | Japt R | 250423T081719Z | Shaggy |
| 113 | Java 11 | 161107T082036Z | Kevin Cr |
| 198 | Whitespace | 250418T051612Z | a stone |
| 049 | Perl 5 | 250417T220702Z | Xcali |
| 068 | Raku Perl 6 rakudo | 250417T212641Z | xrs |
| 055 | Python 2.7 | 161107T132107Z | user3841 |
| 116 | brainfuck | 250329T001647Z | Weird Gl |
| 090 | AWK | 250328T180453Z | xrs |
| 097 | Tcl | 170109T233532Z | sergiol |
| 013 | 05AB1E | 240418T135946Z | Kevin Cr |
| 044 | Regenerate | 240417T192916Z | DLosc |
| 109 | Bash | 240417T183654Z | Ivan |
| 014 | Vyxal j | 210530T094828Z | emanresu |
| 4039 | x8616 machine code | 200903T204811Z | 640KB |
| 020 | Uiua 0.11.0 | 240413T141543Z | RomanPro |
| 065 | R | 170612T185019Z | Giuseppe |
| 020 | SOML | 161106T100620Z | dzaima |
| 026 | Charcoal | 220304T015733Z | jixperso |
| 013 | Nibbles | 211222T214752Z | Darren S |
| 088 | MAWP | 200902T123842Z | Dion |
| 027 | Add++ i | 200909T223759Z | caird co |
| 024 | Pip n | 200902T111028Z | Razetime |
| 009 | Canvas | 180330T103649Z | dzaima |
| 021 | Jstx | 180401T064227Z | Quantum6 |
| 062 | Excel loaded with VBA | 180330T232217Z | Sophia L |
| 020 | Pyth | 180330T215703Z | hakr14 |
| 116 | /// | 161106T093000Z | Erik the |
| 011 | SOGL V0.12 | 171006T164124Z | dzaima |
| 055 | Python 2 | 161107T151913Z | hyperneu |
| 113 | TSQL | 170623T172613Z | BradC |
| nan | Ruby | 161108T190301Z | anna328p |
| 050 | Perl | 161106T175852Z | Denis Ib |
| 124 | PHP | 161109T183553Z | Mario |
| 166 | Lithp | 161106T221101Z | Andrakis |
| 138 | C++ | 161106T161446Z | Mukul Ku |
| 021 | V | 161109T123117Z | statox |
| 056 | Julia | 161109T102832Z | Tasos Pa |
| 179 | Brainfuck | 161107T185843Z | Axel Mat |
| 168 | Brainfuck | 161107T201639Z | Mitchell |
| 044 | MATLAB | 161107T110336Z | PieCot |
| 077 | Powershell | 161108T150539Z | Chavez |
| 149 | Brainfuck | 161106T095418Z | Erik the |
| 034 | Pyth | 161106T123605Z | ElPedro |
| 073 | Python 2 | 161106T090512Z | ElPedro |
| 015 | 05AB1E | 161106T140007Z | Oliver N |
| 022 | Pyth | 161108T013810Z | RK. |
| 076 | Befunge98 | 161108T004758Z | Brian Gr |
| 027 | Vim | 161107T105603Z | statox |
| 120 | Java 7 | 161107T211858Z | cliffroo |
| 140 | Brainfuck | 161107T190331Z | 0WJYxW9F |
| 060 | Python 3 | 161107T182004Z | Cody |
| 044 | PowerShell v2+ | 161107T173324Z | AdmBorkB |
| 016 | APL | 161107T155840Z | Moris Zu |
| 055 | PHP | 161107T143204Z | Titus |
| 059 | GolfSharp | 161107T124823Z | downrep_ |
| 049 | Python 2 | 161106T105819Z | xnor |
| 097 | Swift 3 | 161107T014320Z | Otá |
| 156 | Racket | 161107T020759Z | rnso |
| 016 | MATL | 161106T161256Z | Luis Men |
| 061 | C | 161106T125502Z | Level Ri |
| 104 | GameMaker Language | 161106T133634Z | Timtech |
| 132 | Batch | 161106T212344Z | Neil |
| 069 | PHP | 161106T113657Z | chococha |
| 126 | C# | 161106T125151Z | WerWet |
| 030 | APL | 161106T202834Z | ren |
| 024 | Pyth | 161106T180220Z | Erik the |
| 016 | Pyke | 161106T112744Z | Blue |
| 026 | Vitsy | 161106T150714Z | Addison |
| 048 | Octave | 161106T101332Z | Tom Carp |
| 023 | CJam | 161106T135519Z | Erik the |
| 019 | J | 161106T094857Z | miles |
| 030 | Bubblegum | 161106T122835Z | LegionMa |
| 046 | Ruby | 161106T122313Z | Level Ri |
| 058 | JavaScript ES6 | 161106T114013Z | Arnauld |
| 024 | Dyalog APL | 161106T121435Z | Adá |
| 015 | 05AB1E | 161106T084605Z | Adnan |
| 057 | Haskell | 161106T102858Z | Angs |
| 091 | Selfmodifying Brainfuck | 161106T103544Z | Erik the |
| 021 | Actually | 161106T084029Z | user4594 |
| 016 | Jelly | 161106T085208Z | Erik the |
| 063 | Python 2 | 161106T091210Z | Erik the |
Vyxal 3, 18 bytes
-2 bytes by weird glyphs
'/6×⨪ᐕ6×DD⇄D:W4Y⎘”
<script type="vyxal3">
'/6×⨪ᐕ6×DD⇄D:W4Y⎘” ¶p
</script>
<script>
args=[]
</script>
<script src="https://themoonisacheese.github.io/snippeterpreter/snippet.js" type="module"/>
Java 11, 148 122 113 bytes
v->{String a="/////",b="\\\\\\\\\\",t=(a+b).repeat(5)+"\n",u=(b+a).repeat(5)+"\n";t+=t+t+t+u+u+u+u;return t+t+t;}
-9 bytes thanks to @ceilingcat.
Explanation:
v->{ // Method with empty unused parameter & String return
String a="/////", // Temp-String `a`, containing "/////"
b="\\\\\\\\\\", // Temp-String `b`, containing "\\\\\"
t= // Temp-String `t`, containing:
(a+b) // `a+b`
.repeat(5) // Repeated 5 times
+"\n" // With an additional newline
u= // Temp-String `u`, containing:
(b+a).repeat(5)+"\n";
// Same as above, for `b+a` instead of `a+b`
t+= // Append `t` with:
t+t+t // Three times itself
+u+u+u+u; // Followed by four times `u`
return t+t+t;} // Then return three `t`-Strings appended together
Whitespace, 198 bytes
Commented version:
[N
S T T S N
call_A][N
S T T S N
call_A][N
S S T S N
label_A][S S S T S T T T S S N
push_92_\][S S S T S T T T T N
push_47_/][N
S T T N
call_B][N
S T T N
call_B][N
S T T N
call_B][N
S T T N
call_B][S N
T swap][N
S T T N
call_B][N
S T T N
call_B][N
S T T N
call_B][N
S T T N
call_B][N
T N
return][N
S S T N
label_B][N
S T N
call_C][N
S T N
call_C][N
S T N
call_C][N
S T N
call_C][N
S T N
call_C][N
S T N
call_C][N
S T N
call_C][N
S T N
call_C][N
S T N
call_C][N
S T N
call_C][N
S T N
call_C][N
S T N
call_C][S S S T S T S N
push_10][T N
S S putchar][N
T N
return][N
S S N
label_C][S N
S duplicate][S N
S duplicate][S N
S duplicate][S N
S duplicate][S N
S duplicate][T N
S S putchar][T N
S S putchar][T N
S S putchar][T N
S S putchar][T N
S S putchar][S N
T swap][N
T N
return]
Try it online! (uncommented)
Raku (Perl 6) (rakudo), 68 bytes
say ((('/'x 5~'\\'x 5)x 6~"\n")x 4~(('\\'x 5~'/'x 5)x 6~"\n")x 4)x 3
Python 2.7 66 56 55 bytes
new to code golfing
current version
a="/"*5+"\\"*5;print(4*(6*a+"\n")+4*(6*a[::-1]+"\n"))*3
Thanks Stewie Griffin
Forgot a silly whitespace ;)
66 byte version
a="/"*5+"\\"*5;b=a[::-1];c=6*a+"\n";d=6*b+"\n";e=4*c+4*d;print e*3
brainfuck, 116 bytes
+++++++++[->+>+++++<<]>+>+[->+>++<<]>+<<<<++++++[->++++[->>++++++[->.....>.....<<]<.<]>>>[-<+>]>[-<+>]<<[->>+<<]<<<]
It took me some time to find this answer. I wanted to have an answer smaller than the current Java answer (120 bytes as of the time I'm writing this), and this is the best I was able to do. It may be possible to rearrange some values in order to obtain a smaller answer, but this is pretty good for now. Your turn, Java devs :)
AWK, 90 bytes
END{a="/////";for(b="\\\\\\\\\\";i++<6;)for(m=4;m--;print)for(z=6;z--;)printf i%2?a b:b a}
Tcl, 97 bytes
proc r s\ n {string repe $s $n}
puts [r [r [r /////[r \\ 5] 6]\n 4][r [r [r \\ 5]///// 6]\n 4] 3]
My try to outgolf myself didn't go well :( :
Tcl, 102 bytes
proc r s\ n {string repe $s $n}
proc R s\ t {r [r [r $s 5][r $t 5] 6]\n 4}
puts [r [R / \\][R \\ /] 3]
05AB1E, 13 bytes
'/5׺6×4и»∊л
Also works in the older legacy version of 05AB1E by replacing the º with ∞:
Try it online.
Explanation:
'/ '# Push "/"
5× # Repeat it 5 times as string: "/////"
º # Mirror it horizontally: "/////\\\\\"
6× # Repeat that 6 times as string
4и # Repeat that 4 times as list
» # Join this list with newline delimiter
∊ # Mirror it vertically
Ð # Triplicate this string
» # Join the three strings on the stack with newline delimiter
# (after which it is output implicitly as result)
Regenerate, 44 bytes
((((/{5})(\\{5})){6}
){4}(($5$4){6}
){4}){3}
Pretty straightforward use of groups and repetition. Group 4 is the five forward slashes and group 5 is the five backslashes; backreferencing them in the second set of lines saves one byte.
Bash, 120 109 bytes
z='/ \\'
f(){ printf $1$1$1$1$2$2$2$2;}
for i in {1..144};{
f $z;((i%6))||echo
((i%24))||z=${z#* }\ ${z% *}
}
Vyxal j, 14 bytes
k/5•4ε:RJ6*3ẋf
k/ # "/\"
5• # Repeat each char 5 times
4ε # Repeat 4 times
:RJ # Append a reversed copy
6* # Repeat each line six times
3ẋf # Repeat the whole thing three times
x86-16 machine code, IBM PC DOS, 40 39 bytes
Binary:
00000000: b05c b118 b30c f6c1 0375 0234 73ba 0500 .\.......u.4s...
00000010: cd29 4a75 fb34 734b 75f3 50b0 0dcd 29b0 .)Ju.4sKu.P...).
00000020: 0acd 2958 e2de c3 ..)X...
Listing:
B0 5C MOV AL, '\' ; starting char
B1 18 MOV CL, 24 ; CX = row counter
ROW:
B3 0C MOV BL, 12 ; BX = pattern counter
F6 C1 03 TEST CL, 3 ; have displayed 4 lines of same direction?
75 02 JNZ DIR ; if not, continue with same
34 73 XOR AL, '/' XOR '\'; otherwise, swap the chars
DIR:
BA 0005 MOV DX, 5 ; DX = char counter
PATT:
CD 29 INT 29H ; write char to console
4A DEC DX ; have displayed 5 of the same?
75 FB JNZ PATT ; if not, keep writing
34 73 XOR AL, '/' XOR '\'; otherwise, swap the chars
4B DEC BX ; have displayed 12 patterns on a line?
75 F3 JNZ DIR ; if not, keep writing patterns
50 PUSH AX ; otherwise, save the chars and write a CRLF
B0 0D MOV AL, 0DH ; CR char
CD 29 INT 29H ; write to console
B0 0A MOV AL, 0AH ; LF char
CD 29 INT 29H ; write to console
58 POP AX ; restore original chars
E2 DE LOOP ROW ; loop until written 24 lines written
C3 RET ; return to DOS
A standalone PC DOS executable COM program. Output to console:
R, 72 65 bytes
write(matrix(c(x<-rep(c('/','\\'),24,,5),rev(x)),24,60),1,60,,'')
builds a matrix of appropriate characters and writes it to stdout.
SOML, 20 bytes
/5* \5*+6*6{4{t}5{«
Explanation:
/ push "/", stack: ["/"]
5* repeat it 5 times ["/////"]
\ push "\" ["/////","\"]
5* repeat it 5 times ["/////","\\\\\"]
+ add together ["/////\\\\\"]
6* repeat the string 6 times (it gets long here)
6{ 6 times repeat following code
4{t} output 4 times
5{« put the 1st 5 chars at the end of the string
Charcoal, 26 bytes
UO⁵¦⁴/‖M↓→‖M↓→‖M‖BO²⁰‖BO↓⁸
Try it online! Link is to verbose version of code.
Explanation:
UO⁵¦⁴/ - drawing a 5 by 4 rectangle filled with /
‖M↓→ - reflect and mirror the canvas to the down and right direction (note that for this pattern order doesn't matter)
‖M - reflect mirror without a argument (default is to the right, n times)
‖BO²⁰ - reflect butterfly overlap which would reflect the same thing n times to the left by default
‖BO↓⁸ - 8 characters but this time with a given direction which is down
Optimizing: -9, Thanks to @Neil for the help on reflects.
Nibbles, 13 bytes
^3`<^4`:;^6`<^5"/\\"\$
explanation
^3 # replicate 3 times
`< # sort
^4 # replicate 4 times
`: # list of two lists (for getting newlines)
; # let (save value to $)
^6 # replicate 6 times
`< # sort
^5 # replicate 5 times
"/\\" # the string /\
\$ # reverse the saved value
Note that that last $ can't be omitted because in the binary form the sort needs to place more data after its arg
MAWP, 88 bytes
3[4[6[5[68W1A;1A]%4[68W2A2W;1A]%1A]%52W;1A]4[6[5[68W2A2W;1A]%4[68W1A;1A]%1A]%52W;1A]%1A]
Raise the max executions to at least 15000 to test it :D Oh, and be ready to wait for quite some time for it to finish.
MAWP 2.0, 61 bytes
3[4[6["/////\\\\\":1-]`10;1-]`4[6["\\\\\/////":1-]`10;1-]`1-]
Add++ -i, 27 bytes
L,"/\"5€*6*b]4*d€bR+3*bUBJn
The -i flag simply invokes the function with a clean stack and then outputs its return value.
How it works
L, ; Anonymous function
"/\" ; Push this string STACK = ["/\"]
5€* ; Repeat each character 5 times STACK = [["/////" "\\\\\"]]
6* ; Repeat the array 6 times STACK = [["/////" "\\\\\" "/////" "\\\\\" "/////" "\\\\\" "/////" "\\\\\" "/////" "\\\\\" "/////" "\\\\\"]]
b]4* ; Repeat the whole thing 4 times STACK = [[["/////" "\\\\\" ... "/////" "\\\\\"]]]
d ; Duplicate STACK = [[["/////" "\\\\\" ... "/////" "\\\\\"]] [["/////" "\\\\\" ... "/////" "\\\\\"]]]
€bR ; Reverse the second copy STACK = [[["/////" "\\\\\" ... "/////" "\\\\\"]] [["\\\\\" "/////" ... "\\\\\" "/////"]]]
+ ; Concatenate STACK = [[["/////" "\\\\\" ...] ... [... "\\\\\" "/////"]]]
3* ; Repeat 3 times STACK = [[["/////" "\\\\\" ...] ... [... "\\\\\" "/////"]]]
bUBJn ; Concatenate and grid STACK = ["/////\\\\\...\\\\\/////"]
Pip -n, 24 bytes
(RF('/X6.'\X6)X24)X3<>72
Quad reflect is a bit weird in pip, so this answer uses normal reflect.
The -n flag joins lists with newlines.
Canvas, 10 9 bytes
/54*╬6×3*
Explanation:
/ push "/"
54* extend horizontally 5 times and vertically 4 times
╬ quad-palindromize with 0 overlap
6× repeat horizontally 6 times
3* and again vertically, 3 times
Jstx, 21 bytes
♣/►\:►/;1BO♠/♦/!41o16
Not the shortest solution but I wanted to try this interesting challenge.
Explanation
♣ # Push literal 5
/ # Enter an iteration block over the first stack value.
►\ # Push literal \
: # Push the sum of the second and first stack values.
►/ # Push literal /
; # Push the difference of the second and first stack values.
1 # End an iteration block.
B # Push five copies of the first stack value.
O # Collapse all stack values into a string, then Push that string.
♠ # Push literal 6
/ # Enter an iteration block over the first stack value.
♦ # Push literal 4
/ # Enter an iteration block over the first stack value.
! # Push a copy of the first stack value.
4 # Print the first stack value, then a newline.
1 # End an iteration block.
o # Push the first stack value with characters in reverse order.
1 # End an iteration block.
6 # Ends program execution.
Excel (loaded with VBA), 70 62 bytes
Formula for each cell (A4 through BH27):
=IF(SIN(COLUMN()*0.62)*SIN(ROW()*0.8)>0,"\","/")
I'm not sure how to score this and I couldn't find a consensus. It's a 48 byte pure Excel formula, the same in every cell (but of course the fact that it should be in a particular range is also information). It takes 62 bytes to load it by executing this in the VBA Immediate window.
[A4:BH27]="=IF(SIN(COLUMN()*.62)*SIN(ROW()*.8)>0,""\"",""/"")"
Output
Pyth, 21 20 bytes
J*6S*5"/\\"V6V4J)=_J
Python 3 translation:
J=6*sorted(5*"/\\")
for N in range(6):
for N in range(4):
print(J)
J=J[::-1]
///, 116 bytes
/a/\\\\\\\\\\\\\\\///b/\\\\\\\\\\\\\\\\//A/aaaaa//B/bbbbb//C/ABABABABABAB
//D/BABABABABABA
/CCCCDDDDCCCCDDDDCCCCDDDD
Edit: the \\\\\\\\\\\\\\\/ and \\\\\\\\\\\\\\\\ are actually a single / and \, respectively.
Edit: -3 because I thought of removing i. I think this can't be further golfed.
SOGL V0.12, 11 bytes
└5*5∙╬¡6*3∙
Explanation:
└ push "/"
5* repeat 5 times
5∙ repeat vertically 5 times
έ quad-palindromize with 0 overlap and mirroring characters
6* multiply 6 times horizontally
3∙ multiply 3 times vertically
Python 2, 83 55 bytes
x=('/'*5+'\\'*5)*6;print((x+'\n')*4+(x[::-1]+'\n')*4)*3
-28 bytes thanks to Leaky Nun
T-SQL, 113 bytes
DECLARE @ INT=0L:IF @%8<4PRINT REPLICATE('/////\\\\\',6)ELSE PRINT REPLICATE('\\\\\/////',6)SET @+=1IF @<24GOTO L
Formatted:
DECLARE @ INT=0
L:
IF @%8<4 PRINT REPLICATE('/////\\\\\',6)
ELSE PRINT REPLICATE('\\\\\/////',6)
SET @+=1
IF @<24 GOTO L
Using both string literals seems to be the shortest option, trying to REPLICATE(REPLICATE('/',5)+REPLICATE('\',5) is way longer, as is using additional variables.
Ruby, 83 + 14 = 97 bytes
puts Zlib.inflate Base64.decode64"eNrTB4EYECCdxTVENSP4pLOGqubhE8+j8Twaz6PxDAA3Pofw"
Add 14 bytes for -rzlib and -rbase64 flags.
Perl, 51 50 bytes
Perl 5.10.0+:
perl -E 'say+((@_=("/"x5,"\\"x5)x6,$/)x4,(pop@_,@_,$/)x4)x3'
Perl before 5.10.0 (52 bytes):
perl -e 'print+((@_=("/"x5,"\\"x5)x6,$/)x4,(pop@_,@_,$/)x4)x3'
Ungolfed:
say(
(
(
@_ = ('/' x 5, '\\' x 5) x 6,
$/, # new line symbol
) x 4,
(
pop(@_),
@_,
$/,
) x 4,
) x 3
);
Thanx to @DomHastings for 1 byte.
PHP, 142 124 bytes
<?=str_replace(['#','-'],['/////','\\\\\\\\\\'],wordwrap(str_repeat(str_repeat("#-",24).str_repeat("-#",24), 4),12,"\n",1));
Previous version:
<?for($i=1;$i<4;$i++)echo wordwrap(str_repeat("/////\\\\\\\\\\",24),60,"\n",1)."\n".wordwrap(str_repeat("\\\\\\\\\\/////",24),60,"\n",1)."\n";
Output:
C:\PHP\>php this-is-my-pillow.php
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
Lithp, 166 characters
Line split for readability.
#::((def x #S,N::(invoke S repeat N))(var A (x "/" 5))(var B (x "\\" 5))
(var C (+ (x (+ A B) 6) (nl)))(var D (+ (x (+ B A) 6) (nl)))
(print (x (+ (x C 4) (x D 4)) 5)))
Sample usage:
% pillow.lithp
(
(def f #::((def x #S,N::(invoke S repeat N))(var A (x "/" 5))(var B (x "\\" 5))(var C (+ (x (+ A B) 6) (nl)))(var D (+ (x (+ B A) 6) (nl)))(print (x (+ (x C 4) (x D 4)) 5))))
(f)
)
Run with:
./run.js pillow.lithp
This is a fairly simple solution that repeats characters. There is no standalone repeat function yet, so invoke is used to call "string".repeat(N) and adds a bit to the count.
C++ 138
void P(){int i,j,k,l;for(i=0;i<3;i++)for(j=0;j<8;j++)for(k=0;k<12;k++)for(l=0;l<5;l++)cout<<((j/4)?(k%2)?'/':'\\':(k%2)?'\\':'/')<<'\n';}
Ungolfed
#include<conio.h>
#include<iostream>
using namespace std;
void P()
{
int i,j,k,l;
for(i=0;i<3;i++)
for(j=0;j<8;j++)
for(k=0;k<12;k++)
for(l=0;l<5;l++)
cout<<((j/4)?(k%2)?'/':'\\':(k%2)?'\\':'/')<<'\n';
}
int main()
{
P();
_getch();
return 0;
}
V, 22 21 bytes
Edit One byte won, thanks @DjMcMayhem:
5á\5á/05ä$4Ä5x$p4Ä3ä}
Changes are:
Y4P->4ÄUse V duplicate line instead of Vim built-in command (this will add a blank line at the end of the paragraph)3äG->3ä}Duplicate the paragraph instead of the whole buffer (to avoid blank line generated by previous change)
Original post
5á\5á/05ä$Y4P5x$p4Ä3äG
Decomposed like this:
5á\ Write 5 \
5á/ Write 5 / after
0 Go to the beginning of the line
5ä$ Copy the text to the end of the line and repeat it 5 times
Y4P Copy the line and create 4 new copies
5x$p Delete the 5 first characters and put them at the end of the line
4Ä Duplicate this line
3äG Duplicate the whole text
Julia, 56 bytes
a="////\\\\\\\\"^6*"\n";print((a^4*a[[48:-1:1,49]]^4)^3)
Brainfuck, 179 bytes
->++++++++[-<++++++>]++>+++++++++[-<++++++++++>]++++++++++>>>>+++[-<++++[-<++++++[-<+++++[-<<<.>>>]+++++[-<<.>>]>]<<.>>>]++++[-<++++++[-<+++++[-<<.>>]+++++[-<<<.>>>]>]<<.>>>]>]
I know this isn't the best score in the thread but I wanted to try out brainfuck and give this a try.
Edit: I must've made an error while copypasting. This version should work
Brainfuck, 168 bytes
++++++[>++++++++<-]>-<+++++++++[>>++++++++++<<-]>>++<<+++++[>>>++<<<-]>>>>+++[>++++[>++++++[<<<<<.....>.....>>>>-]<<<.>>-]++++[>++++++[<<<<.....<.....>>>>>-]<<<.>>-]<-]
MATLAB, 58 44 bytes
Thanks to @Stewie Griffin for saving a bunch of bytes ;)
[repmat(kron(['/\';'\/'],ones(4,5)),3,6),'']
Old version:
p=@()char(47+45*kron(ones(3,6),kron([0 1;1 0],ones(4,5))))
Powershell, 77 bytes
I must say I thought this would be easier with PowerShell, but it's quite hard to create something more condense than this.
$a=@("/","\");"$(1..6|%{1..3|%{1..6|%{$a[$b]*5;$a[!$b]*5};"rn"}; $b=!$b})"
More readable:
$a=@("/","\")
"$(1..6|%{
1..3|%{
1..6|%{
$a[$b]*5
$a[!$b]*5
}
"`r`n"}
$b=!$b})"
I'm using the index numbers of the array in order to decide whether I should put \ or / and between every loop I simply toggle the variable.
Brainfuck, 149 bytes
++++++++++>++++++[>++++++++<-]>->+++++++++[>++++++++++<-]>++>+++[<<++++[<<++++++[>.....>>.....<<<-]<.>>>-]++++[<<++++++[>>>.....<<.....<-]<.>>>-]>>-]
This uses 6 cells (no wrapping, no modulo). Here they are:
0A 00 2F 00 5C 00
The 00 cells are used for the loop counters. Here, the counters are filled in with initial values:
0A 06 2F 04 5C 03
The leftmost counter is for the innermost loop (yes, I use nested loops of depth 3). Please note that the 4th cell (04 counter) is used twice, once for /////\\\\\..., and once for \\\\\/////... every time.
0A, 2F and 5C are the characters \n, / and \, respectively.
Pyth, 49 48 40 37 34 bytes
J60K*24+*5\/*5\\V24:*3+K_K*JN+J*JN
OK, I'm just learning Pyth so this is a direct port of my Python answer. Still a lot of golfing to do but it works so I am posting it anyway. Any hints gratefully received :)
1 byte saved with thanks to @Flp.Tkc
-8 by working out how to do it with a variable
-3 by moving the *24 to the assignment of K
-3 by getting rid of the quotes
Python 2, 86 80 76 74 73 bytes
for z in range(24):a=('/'*5+'\\'*5)*24;print((a+a[::-1])*3)[z*60:z*60+60]
Could probably golf a few more off it but it's a start.
Edit
Saved 6 by removing some unneeded brackets
Another 4 by using a single string and then reversing it
Thanks @Adnan. Had a late night last night and still not fully awake yet :p
-1 by moving the *24 to the variable instead of using it twice
05AB1E, 15 bytes
„/\5×{R6×6FR4F=
Explanation:
„/\ # Push "/\"
5× # Repeat string five times: "/\/\/\/\/\"
{ # Sort: "/////\\\\\"
R # Reverse: "\\\\\/////
6× # Repeat string six times
6F # Repeat the following six times:
R # Reverse
4F # Repeat the following four times:
= # Print without popping
Uses the CP-1252 encoding.
Pyth, 22 bytes
V6V4V12p*5?%+bN2\\\/)k
Try it here.
Explanation:
V6 Loop 6 times, with N from 0 to 5:
V4 Loop 4 times, with H from 0 to 3:
V12 Loop 12 times, with b from 0 to 11:
p Print without newline
* The repetition
5 5 times of
? if
% the remainder
+ b N when the sum of b and N
2 is divided by 2
\\ then the "\" character
\/ else the "/" character
) End
(implicitly print with newline)
k k (empty string)
(implicit end)
(implicit end)
Sorry if the explanation is a little hard to understand, but it was kinda complicated.
Befunge-98, 76 bytes
'/\::2%0`!\4c*/2%0`!-> #0 #\ #\' $ #\_\3k:4k,1+:c%0`!> #0 #, #a_:cad+*\`!#@_
String processing/generation can be difficult with only a stack available...
A couple bytes may be able to be shaved off here or there, but I beat brainfuck, so I'm happy.
Explanation
Push '/' on the stack
Swap top two (at the beginning, zero will now be on top). Call top = iterator = n
Calculate (n % 2 == 0) != ((n / 48) % 2 == 0)
If true, swap top two, replace '/' with '\', swap again
Swap top two (so that we now have the character to print on top, followed by n)
Duplicate the char 4 times, and print 5 times
Increment n
If n % 12 == 0, print a newline character
If !(288 > n), end, else repeat
Vim, 44 27 bytes
EDIT Lot of bytes won thanks to @DrMcMoylex:
5i\<esc>5a/<esc>0y$5PY4P5x$pY3PyGPP
Original answer:
I'm not sure that really fits the rules of this site but I thought that was fun to try it:
i\<esc>59.:s;\v(.{5})\1;\1/////;g<CR>Y4P5x$pY3PyGPP
Which can be decomposed like this:
i\<esc> Insert a \
59. Repeat 59 time the insertion
:s;\v(.{5})\1;\1/////;g<CR> Match 5 characters followed by the same 5 characters
And replace them by these 5 characters followed by 5 /
Y4P Copy the line and repeat it 4 times
5x$p On the current line delete 5 characters and put them
at the end of the line
Y3P Copy the line and repeat it 3 times
yG Copy all the lines
PP Repeat them 2 times
Java 7, 120 bytes
String c(){String r="";for(int i=0;i<1440;r+=(i%60<1?"\n":"")+(i/60%8<4?i%10<5?"/":"\\":i%10<5?"\\":"/"),i++);return r;}
Pushed everything into one loop. Beats Brainfuck, mission accomplished.
See it online: https://ideone.com/pZjma3
Brainfuck, 140 bytes
>>>++++++++[>++++++>++++++++++++<<-]++++++++++>->----<<<<<+++[>++++[>++++++[>>.....>.....<<<-]>.<<-]++++[>++++++[>>>.....<.....<<-]>.<<-]<-]
:-D
Python 3, 60 bytes
Lots of multiplying strings!
print((((('/'*5+'\\'*5)*6+'\n')*4)+(('\\'*5+'/'*5)*6+'\n')*4)*3)
Output
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
PowerShell v2+, 44 bytes
,(,('/////\\\\\'*6)*4+,('\\\\\/////'*6)*4)*3
Abuses the crap outta the default Write-Output behavior to put a newline between elements.
Explanation
I'm also trying out a new explanation format, rather than the long prose I traditionally write.
,(,('/////\\\\\'*6)*4+,('\\\\\/////'*6)*4)*3
'/////\\\\\'*6 # Repeat this string 6 times
,( )*4 # Repeat it into an array of four elements
+ # Array concatenate with
,('\\\\\/////'*6)*4) # The same with the slashes the other way
,( )*3 # Repeat it into an array of three elements
# (i.e., 24 total strings)
PHP, 55 bytes
for(;$i<1440;)echo"/\\"[($i/5^$i/240)&1],"\n"[++$i%60];
toggles between forward and backward slash every 5 characters, inverted every 240 characters;
not counting newlines; newlines inserted every 60 characters.
has one trailing newline. Run with -r.
recursive program for 66 bytes:
<?="/\\"[($i/5^$i/240)&1]."\n"[++$i%60];if($i<1440)include"p.php";
save to file p.php; call from CLI (or insert ($i?"":"<pre>"). after <?=)
GolfSharp, 59 bytes
r(0,1440).s(n=>n%10<5^n%480<240?"\\":"/").j().S(60).j("\n")
Python 2, 49 bytes
b,a='\/';exec("print(a*5+b*5)*6;"*4+"a,b=b,a;")*6
Thanks to Mitch Schwartz for this clean method that saves a byte. The idea is to print four lines of ('\\'*5+'/'*5)*6, swap the roles of slash and backslash, and then do that whole process 6 times. The two characters are stored in a and b, and swapped as a,b=b,a. The double-loop is double by generating the following code string, then executing it with exec:
print(a*5+b*5)*6;print(a*5+b*5)*6;print(a*5+b*5)*6;print(a*5+b*5)*6;a,b=b,a;print(a*5+b*5)*6;print(a*5+b*5)*6;print(a*5+b*5)*6;print(a*5+b*5)*6;a,b=b,a;print(a*5+b*5)*6;print(a*5+b*5)*6;print(a*5+b*5)*6;print(a*5+b*5)*6;a,b=b,a;print(a*5+b*5)*6;print(a*5+b*5)*6;print(a*5+b*5)*6;print(a*5+b*5)*6;a,b=b,a;print(a*5+b*5)*6;print(a*5+b*5)*6;print(a*5+b*5)*6;print(a*5+b*5)*6;a,b=b,a;print(a*5+b*5)*6;print(a*5+b*5)*6;print(a*5+b*5)*6;print(a*5+b*5)*6;a,b=b,a;
50 bytes:
s='/'*5+'\\'*5;exec("print s*6;"*4+"s=s[::-1];")*6
Makes the line string, prints it four times and then reverses it, then does that 6 times. Does so by generating the following code, then executing it:
print s*6;print s*6;print s*6;print s*6;s=s[::-1];print s*6;print s*6;print s*6;print s*6;s=s[::-1];print s*6;print s*6;print s*6;print s*6;s=s[::-1];print s*6;print s*6;print s*6;print s*6;s=s[::-1];print s*6;print s*6;print s*6;print s*6;s=s[::-1];print s*6;print s*6;print s*6;print s*6;s=s[::-1]
Here are some of the iterations of my golfing:
for c in([1]*4+[-1]*4)*3:print('/'*5+'\\'*5)[::c]*6
for i in range(24):print('/\\'*5+'\/'*5)[i/4%2::2]*6
for c in range(24):print('\\'*5+'/'*5)[::(c&4)/2-1]*6
for i in range(24):print('/'*5+'\\'*5)[::1-i/4%2*2]*6
for c in([1]*4+[0]*4)*3:print('\/'*5+'/\\'*5)[c::2]*6
for c in([1]*4+[0]*4)*3:print('\/'[c]*5+'/\\'[c]*5)*6
for c in(['/\\']*4+['\/']*4)*3:print(c[0]*5+c[1]*5)*6
for c in([5]*4+[-5]*4)*3:print('/'*c+'\\'*5+'/'*-c)*6
print((('/'*5+'\\'*5)*6+'\n')*4+(('\\'*5+'/'*5)*6+'\n')*4)*3
for x in(['/'*5+'\\'*5]*4+['\\'*5+'/'*5]*4)*3:print x*6
a='/'*5;b='\\'*5
for x in([a+b]*4+[b+a]*4)*3:print x*6
s='/'*5+'\\'*5
for x in([s]*4+[s[::-1]]*4)*3:print x*6
s=('/'*5+'\\'*5)*9
exec("print s[:60];"*4+"s=s[5:];")*6
a='/'*5;b='\\'*5
for i in range(24):print[a+b,b+a][i/4%2]*6
Swift 3, 100 99 97 bytes
var a="/////",b="\\\\\\\\\\",c=""
(1...144).map{c+=a+b+($0%6<1 ?"\n":"")
$0%24<1 ?swap(&a,&b):()}
Could save 1 byte if Swift print function did not add a newline by default.
Edit 1:
Saved 1 byte by changing the if to ternary
if(i%24<1){swap(&a,&b)} -> i%24<1 ?swap(&a,&b):()
Edit 2:
Changed from for to map over the CountableClosedRange
Racket 156 bytes
(define g #t)(for((k 24))(for((i 12))(for((j 5))(display(if g "/""\\")))(set! g(if g #f #t)))
(when(= 0(modulo(add1 k)4))(set! g(if g #f #t)))(displayln""))
Ungolfed:
(define(f)
(define g #t)
(for ((k 24))
(for ((i 12))
(for ((j 5))
(display (if g "/" "\\")))
(set! g (if g #f #t)))
(when (= 0 (modulo (add1 k) 4))
(set! g (if g #f #t)))
(displayln "")))
Testing:
(f)
Output:
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
MATL, 18 16 bytes
'\/'6:&+thK5&Y")
Explanation
'\/' % Push this string
6: % Push array [1 2 3 4 5 6]
&+ % 6×6 matrix with all pair-wise additions from that array
th % Concatenate horizontally with itself. Gives a 6×12 matrix
K % Push 4
5 % Push 5
&Y" % Repeat each entry of the matrix 4 times vertically and 5 times horizontally
% This gives a 24×60 matrix
) % Index (modularly) into the string. This produces the desired 24×60 char array
C, 66 61 bytes
5 bytes saved thanks to orlp.
Straightforward character by character printing. 61 characters per row, last is newline (ASCII 10) and the others alternate between /47 and \ 92.
i;f(){for(i=1463;i;)putchar(i--%61?i%61/5+i/244&1?92:47:10);}
//call like this
main(){f();}
GameMaker Language, 104 bytes
You should make sure that uninitialized variables don't throw an error. This setting is in the main page of Preferences. Otherwise, add e='' to the beginning of the program.
a="/////"b="\\\\\"d=b+a+b+a+b+a+b c=a+d d+=a for(i=0;i<24;i++)if i mod 8>3e+=d else e+=c e+="#" return e
P.S. Yes, each part of the for loop needs an expression. So I can't for(i=0;i<24;) and have i++ later.
Output
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
Batch, 132 bytes
@set s=/////\\\\\
@set s=%s%%s%%s%%s%%s%%s%
@set s=%s% %s:~5%/////
@for %%s in (%s% %s% %s%)do @for /l %%i in (1,1,4)do @echo %%s
Works by building up the two types of row, then looping through six rows four times per row.
PHP, 73 69 bytes
for($s='/\\';$i<1440;$i++)echo$i%60<1?'
':'',$s[($i/5+($i/240|0))%2];
Demo
C#, 126 Bytes
var s="";var c="/";for(int a=0;a<24;){for(int b=0;b<60;)s+=b++%5>0?c:c=="/"?c=@"\":c="/";s+="\n";c=a++%3>1?c=="/"?@"\":"/":c;}
string s is output.
It could be 3 byte less, when it is infinite.
Ungolfed
var s = "";
var c = "/";
for (int a = 0; a < 24;)
{
for (int b = 0; b < 60;)//write line
{
s += b++ % 5 > 0 ? c : c == "/" ? c = @"\" : c = "/";//Change /to \ and vice versa after five times
}
s += "\n";
c = a++ % 3 > 1 ? c == "/"? c = @"\" : c = "/" :c; //Change /to \ and vice versa after three lines
}
APL, 30 bytes
A←240⍴'/////\\\\\'⋄24 60⍴A,⊖A
I'm quite new to APL, (I'm using APLX, but this should work across most implementations of APL), so this is a quite simplistic solution.
Explanation:
A ← 240 ⍴ '/////\\\\\' ⍝ set A to be a 240 character vector populated with '/////\\\\\'
⋄ ⍝ statement separator
24 60 ⍴ A,⊖A ⍝ populate a 24 by 60 character matrix with the concatenation
of A and the reverse of A (⊖A)
Pyth, 24 bytes
Jj*4[*6+*5\/*5\\;j*3[J_J
Explanation:
Jj*4[*6+*5\/*5\\;j*3[J_J
4 4
6 6
5 5
\/ "/"
* Repeat
5 5
\\ "\\"
* Repeat
+ Concatenate
* Repeat
[ List
* Repeat
j Join
J Assign copy to J
; Close argument list
3 3
J J
J J
_ Reverse
[ List
* Repeat
j Join
Pyke, 16 bytes
"/\"6*5m*n+4*sD3
After update today that allowed " in string literals, 17 bytes
"/\\"6*5m*n+4*sD3
Octave, 50 48 bytes
Anonymous function:
@()repmat([A=repmat(47,4,5) B=A*2-2;B A ''],3,6)
You can try online here. Simply run the above command and then run the function with ans().
Essentially this creates an array of the value 47 which is 4 high and 5 wide. It then creates a second array of value 92 which is the same size.
The two arrays are concatenated into a checkerboard of [A B;B A]. The '' is concatenated as well to force conversion to character strings.
Finally the whole array is replicated 3 times down and 6 times across to form the final size.
- Saved 2 bytes, thanks @StewieGriffin
CJam, 24 23 bytes
"/\\"5e*6*]4*N*_W%]3*N*
Thanks 8478 (Martin Ender) for -1.
Explanation:
"/\\"5e*6*]4*N*_W%]3*N* Code
"/\\" Push "/\\"
5 Push 5
e* Repeat each
6 Push 6
* Repeat
] Wrap stack from [ to ToS in array
4 Push 4
* Repeat
N Push N = "\n"
* Join
_ Duplicate
W Push W = -1
% Take every nth item
] Wrap stack from [ to ToS in array
3 Push 3
* Repeat
N Push N = "\n"
* Join
J, 31 28 19 bytes
4#_60]`|.\5#72$'/\'
Usage
4#_60]`|.\5#72$'/\'
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
Bubblegum, 30 bytes
00000000: d307 8118 1020 9dc5 3544 3523 f8a4 b386 ..... ..5D5#....
00000010: aae6 e113 cfa3 f13c 1acf a3f1 0c00 .......<......
Obligatory Bubblegum answer.
Ruby, 46 bytes
Creates the following string (70 characters, one set more than needed) then alternates between sampling characters 0..59 and 5..64from it.
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
code and output
24.times{|i|puts ((?/*5+?\\*5)*7)[i/4%2*5,60]}
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////
interesting mistake (a 7 instead of a 5)
24.times{|i|puts ((?/*5+?\\*5)*7)[i/4%2*7,60]}
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\
\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\
\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\
\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\
\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\
\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\
\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\
\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\
\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\
\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\
JavaScript (ES6), 68 60 58 bytes
A recursive function. Several optimizations inspired from chocochaos answer.
f=(n=1440)=>n--?'/\\'[n/240&1^n/5&1]+(n%60?'':`
`)+f(n):''
Demo
f=(n=1440)=>n--?'/\\'[n/240&1^n/5&1]+(n%60?'':`
`)+f(n):''
console.log(f());
Dyalog APL, 24 bytes
(60⍴5/0 4)⊖60/⍪∊3⍴⊂4/'/\'
05AB1E, 18 15 bytes
Code:
„/\5×{4Å6×»6F=R
Explanation:
„/\ # Push the string "/\"
5× # Repeat 5 times: "/\/\/\/\/\"
{ # Sort, resulting in: "/////\\\\\"
4Å6 # Create a list of 6's with length 4: [6, 6, 6, 6]
× # Vectorized string multiplication
» # Join by newlines
6F # Do the following six times..
= # Print with a newline without popping
R # Reverse the string
Uses the CP-1252 encoding. Try it online!
Haskell, 77 70 57 bytes
a%b=(<*[1..a]).([1..b]>>)
unlines$4%3$5%6<$>["/\\","\\/"]
Boring concats and replicates instead of playing with sines. Old was:
unlines[["\\/"!!(ceiling$sin(pi*x/5)*sin(pi*y/4))|x<-[0.5..59]]|y<-[0.5..23]]
Self-modifying Brainfuck, 91 bytes
>>+++[<++++[<++++++[<.....<.....>>-]<<<.>>>>-]++++[<++++++[<<.....>.....>-]<<<.>>>>-]>-]
\/
Same as my brainfuck answer, but uses the 3 last characters of the source code instead of generating them at runtime.
Actually, 21 bytes
"/\"5*SR6*;4α@R4α+3αi
-1 byte from Adnan
Explanation:
"/\"5*SR6*;4α@R4α+3αi
"/\"5* "/\" repeated 5 times
SR sort and reverse (result: "\\\\\/////")
6* repeat string 6 times (forms one row)
;4α copy and push a list containing 4 copies
@R4α+ push a list containing 4 copies of the reversed string, append to previous list (now we have one row of diamonds)
3α repeat pattern vertically 2 more times
i flatten and implicitly print
Python 2, 63 bytes
a='\n'.join([('/'*5+'\\'*5)*6]*4);print'\n'.join([a,a[::-1]]*3)
For Python 3, do this (65 bytes):
a='\n'.join([('/'*5+'\\'*5)*6]*4);print('\n'.join([a,a[::-1]]*3))

