Make me a blanket!

18

3

I want a blanket that looks like this. Each strip goes over, under, over, under. Can you print it?

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

Trailing spaces at the end of each line and trailing newlines are acceptable.

Remember, this is , so the code with the fewest bytes wins.

Leaderboards

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

# Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

# Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the leaderboard snippet:

# [><>](http://esolangs.org/wiki/Fish), 121 bytes

var QUESTION_ID=99023,OVERRIDE_USER=12537;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>

Oliver Ni

Posted 2016-11-08T17:51:30.740

Reputation: 9 650

The right edge seems misaligned. – Magic Octopus Urn – 2016-11-08T17:55:18.770

Is the left edge not overlapping intended? – xnor – 2016-11-08T17:56:33.467

@xnor Sorry, my bad. – Oliver Ni – 2016-11-08T17:57:35.627

@carusocomputing Fixed. – Oliver Ni – 2016-11-08T17:58:10.063

There's still some weirdness -- the left edge messes up the alternation of overs and unders. – xnor – 2016-11-08T17:59:26.090

@xnor No, it doesn't. – Oliver Ni – 2016-11-08T18:01:30.267

@Oliver You sure? Look at the \\\\ strand from the top left corner. It goes over, over, under, over, under, over. – xnor – 2016-11-08T18:02:54.237

@xnor Oh, okay... let me fix that. – Oliver Ni – 2016-11-08T18:03:52.730

@xnor Fixed.... – Oliver Ni – 2016-11-08T23:19:11.867

11Had you used the Sandbox, those issues could have been avoided before this went up on main. – Mego – 2016-11-09T06:55:41.787

Related: This is my pillow

– sergiol – 2018-04-10T14:18:38.343

Answers

8

Python 2, 84 bytes

R=range(24)
for i in R:print''.join(" \// \/\\"[i+~j>>2&1^i+j>>1&2^i&4]for j in R*2)

Thanks to Sp3000 for 6 bytes from turning the arithmetic operations into bitwise ones.

xnor

Posted 2016-11-08T17:51:30.740

Reputation: 115 687

Whoa... how???? – Oliver Ni – 2016-11-10T05:50:56.190

1i+~j>>2&1^i+j>>1&2^i&4, perhaps? – Sp3000 – 2016-11-10T07:13:09.627

@Sp3000 That's some nice bitwise precedence. I'll have to remember that when combining arithmetically-derived booleans into an index. – xnor – 2016-11-10T18:05:57.267

6

Pyth, 36 bytes

V24sm@" \// \/\\"im<3%k8++BNdt-NdT48

Try it online: Demonstration

Explanation:

We can determine the symbol by checking 3 conditions:

A := row % 8 > 3
B := (row + column) % 8 > 3
C := (row - column - 1) % 8 > 3

If we interpret [A,B,C] as a binary number, we get the following mapping:

01234567
 \// \/\

We can also interpret [A,B,C] as decimal number and perform a modular indexed lookup in the string. This doesn't make a difference because 10 mod 8 = 2.

Now to the code:

V24 iterates N (row-idx) over [0, 1, ..., 23].

sm...48 maps the numbers d (column-idx) in [0, 1, ..., 47] to chars and print the combined string.

++BNd generates the list [N, N+d], +...t-Nd appends N-d-1. So we have get the list [N, N+d, N-d-1]. m<3%k8 checks for each computed number k, if 3 < k % 8, so this gives the list with the conditions [A, B, C].

i...T convents this to a decimal number and then @" \// \/\\" does the lookup in the string.

More or less the same code in Python2: 98 bytes:

R=range(8)
for r in R*3:print''.join(" \// \/\\"[4*(r>3)+2*((r+c)%8>3)+((r-c-1)%8>3)]for c in R*6)

Jakube

Posted 2016-11-08T17:51:30.740

Reputation: 21 462

Just trying to get to grips with Pyth so any decent answer with a good explanation gets an upvote from me. was going to try Pyth after my base 3 experiment :) – ElPedro – 2016-11-09T21:02:07.063

You should post the Python2 answer as well... – Jerry Jeremiah – 2016-11-10T04:14:19.413

3

Python 3, 174 172 138 bytes

print("\n".join(o*6for o in("bbbb////"," bb//// ","  ////  "," ////bb ","////bbbb","b//  bbb","bb    bb","bbb  //b")*3).replace("b","\\"))

Found the smallest pattern I could find in the blanket (the "under" and "over" pattern), stuck it in a list and added some list comprehension and string manipulation to unpack it all. Substituted all escaped backslashes by "b" and replaced them back later to save a few bytes.

Thanks to Oliver for golfing off 2 bytes!

Took 34 bytes off by changing the pattern - the whole pattern for the blanket is now in a single list, so only one for loop is needed to unwrap the pattern.

TheCrazyInventor

Posted 2016-11-08T17:51:30.740

Reputation: 31

1Welcome to PPCG! nice first post! You can shave a byte in python 2 I think, you don't need the parends for print. – Rɪᴋᴇʀ – 2016-11-09T15:06:39.397

1Thank you Easterly Irk, I've been lurking around in code golf for too long now, so I decided to participate. :) – TheCrazyInventor – 2016-11-09T15:16:48.880

1You can save two byte by removing the space after 0*6 and u*6 – Oliver Ni – 2016-11-09T16:04:00.470

1You could save 4 bytes by using the "b" for double backslashes and anywhere you need a single backslash just use escaping:print((("\n".join(o*6 for o in("bb////"," b//// "," //// "," ////b ",""))+"\n".join(u*6 for u in("////bb","\\// b\\","b b","b\\ //\\","")))*3).replace("b","\\\\")) – dzaima – 2016-11-09T19:31:07.467

dzaima: your code doesn't seem to generate a valid blanket. – TheCrazyInventor – 2016-11-10T08:19:16.733

3

Perl, 209 + 17 = 226 bytes

Run with -mList::Util=max -M5.010 (the second flag is free). It's not winning any byte count competitions, but here's my solution.

for(0..7){@b=(1)x8;@b[$_+3..$_+7]=(3)x4;@b[7-$_..10-$_]=(2)x4;for$c(0..2){$b[$c+8]=max$b[$c+8],$b[$c];$b[5-$c]=max$b[5-$c],$b[13-$c];}push@a,sprintf("%-8s",join("",@b[3..10])=~tr[123][ /\\]r)x6;}say for@a,@a,@a

Readable:

for(0..7){
    @b=(1)x8;
    @b[$_+3..$_+7]=(3)x4;
    @b[7-$_..10-$_]=(2)x4;
    for$c(0..2){
        $b[$c+8]=max$b[$c+8],$b[$c];
        $b[5-$c]=max$b[5-$c],$b[13-$c];
    }
    push@a,sprintf("%-8s",join("",@b[3..10])=~tr[123][ /\\]r)x6
}
say for@a,@a,@a

Procedurally generates each segment, then repeats the pattern 6 times, then outputs the total result 3 times.

Gabriel Benamy

Posted 2016-11-08T17:51:30.740

Reputation: 2 827

Woah,I'm not the longest answe any more :) +1 for doing it in Perl anyway. – ElPedro – 2016-11-09T23:01:53.450

I could have done it the same way as everyone else (just printing a bunch of lines), but I decided to do things algorithmically instead of explicitly because I felt it was cooler. – Gabriel Benamy – 2016-11-09T23:10:02.520

Cool by my standards. I've taken an approach that I have never tried before cos it was an interesting challenge. As I said, +1. No insult intended by my comment. That's why I upvoted. – ElPedro – 2016-11-09T23:15:23.270

3

Python 2, 171 170 168 bytes

a,b,c=r"\\","/"*4," "
f,g=c*2,c+a+b+c
d=(a*2+b)*6,g*6,(f+b+f)*6,g[::-1]*6,(b+a*2)*6,('\\//'+f+a+"\\")*6,(a+f*2+a)*6,(a+"\\"+f+'//\\')*6
for e in 0,1,2:print'\n'.join(d)

Not pretty and not clever. Just sets variables for the most often used groups of strings then combines them and prints the result 3 times. May try and golf it more later if I don't find a better approach.

1 byte saved by using raw input on the a assignment. Thanks @nedla2004

-2 by assigning a couple of variables but still not a serious competitor

ElPedro

Posted 2016-11-08T17:51:30.740

Reputation: 5 301

1You could define a as r"\" – nedla2004 – 2016-11-09T17:59:28.037

Thanks @nedla2004 Good point. Threw this together pretty quickly and was going to look at it later. That's a good start :) – ElPedro – 2016-11-09T18:37:24.023

Most interested in finding a way round the *6 on each tuple element though. Any ideas? – ElPedro – 2016-11-09T18:41:41.407

1I don't know how you could do that, but the last line can be exec r"print'\n'.join(d);"*3. – nedla2004 – 2016-11-09T20:26:43.457

I just posted an alternative just out of interest. Would value your comments on that also. – ElPedro – 2016-11-09T20:47:41.137

2

PHP 157 126 bytes

Taking the changes @Titus lists in the comments... I'm annoyed I missed point 1 which I should have caught, but I didn't know strtr() existed which is where most of the savings come - nice work Titus!

NEW:

while($i<32)echo$b=strtr([3322,' 322 ','0220',' 223 ',2233,12013,3003,13021][$i++%8],['  ','\\','//','\\\\']),"$b$b$b$b$b\n";

OLD:

<?$a=[zzyy,' zyy ',syys,' yyz ',yyzz,xysxz,zssz,xzsyx];while($i<32){$b=$a[$i++%8];$b=str_replace([z,x,y,s],['\\\\','\\','//','  '],$b);echo"$b$b$b$b$b$b
";}

Because all the backslashes need escaping it saves quite a bit of space to pack them up as different character and replace them for output, and then once I'm calling str_replace() it makes sense to use it as often as possible.

ToXik-yogHurt

Posted 2016-11-08T17:51:30.740

Reputation: 311

1

You can remove the open tag if you use -r. Use these five steps to save another 30 bytes: http://ideone.com/wt4HGB 1) use $a[...] directly as str_replace parameter instead of assigning it. 2) strtr instead of str_replace. 3) Use digits instead of letters. 4) Include the assignment in the echo. 5) Don´t assign $a, just use it.

– Titus – 2016-11-10T14:34:41.857

2

SOML, 106 bytes

3{"\\\\////”6*p" \\//// ”6*p"  ////  ”6*p" ////\\ ”6*p"////\\\\”6*p"\//  \\\”6*p"\\    \\”6*p"\\\  //\”6*p

a non-competing version using a function that I've only recently added: (83 67 66 bytes)

explanation:

  →$\\→#////→@”6*p"→~3{"##@~ #@ ~$@$~ @# ~@##~\//$#\~#$$#~#\$//\~”
  →$                                                                in the further code replace "$" with "  "
    \\→#                                                            replace "#" with "\\"
        ////→@                                                      replace "@" with "////"
              ”6*p"→~3{"##@~ #@ ~$@$~ @# ~@##~\//$#\~#$$#~#\$//\~” the code to exchange stuff in

so that results in:
”6*p"→~3{"\\\\////~ \\//// ~  ////  ~ ////\\ ~////\\\\~\//  \\\~\\    \\~\\\  //\~”
”6*p"→~3{"A~B~C~D~E~F~G~H~”  modified version of the program (removing "/","\" and " " and replaced with A,B,C,ect.)
”6*p"→~                      replace in the further program "~" with ”6*p" which is:
”                            end string
 6*                          repeat the last thing in stack 6 times
   p                         output the result
    "                        start a string
resulting program: 
3{"A”6*p"B”6*p"C”6*p"D”6*p"E”6*p"F”6*p"G”6*p"H”6*p"”
shortened example:
3{"A”6*p"B”6*p"H”6*p"”
3{                      repeat 3 times
  "A”                   push "A" (original: "\\\\////")
     6*p                output it multiplied by 6
        "B”             push "B" (original: " \\//// ")
           6*p          output it multiplied by 6
              "H”       push "H" (original: "\\\  //\")
                 6*p    output it multiplied by 6
                    "”  push an empty string (shorter to do ~” than ”6*p)

dzaima

Posted 2016-11-08T17:51:30.740

Reputation: 19 048

2

Perl, 132 131 113 bytes

@a=((0)x4,1..4);map{say+(map$a[7-$_]?$a[$_]*$r?'/':'\\':$a[$_]?'/':$",0..7)x6;push@a,shift@a;$_%4||($r=!$r)}0..23

Ungolfed:

use strict;
use warnings;
use feature 'say';

my @a = ((1) x 4, (0) x 4);  # print '\' if true
my @b = ((0) x 4, (1) x 4);  # print '/' if true
my $r = 0;                   # print '\' over '/' if true

for (0 .. 23) {
    say((map { $a[$_] ? ($b[$_] * $r ? '/' : '\\') : ($b[$_] ? '/' : ' ') } 0 .. 7) x 6);
    unshift(@a, pop(@a));    # circular shift to left
    push(@b, shift(@b));     # circular shift to right
    $r = !$r if !($_ % 4);   # change print priority
}

Denis Ibaev

Posted 2016-11-08T17:51:30.740

Reputation: 876

2

Python, 245 236 234 233 230 216 212 198 195 bytes

OK, longer than my last (and any other) answer but would be interested in feedback on the approach.

for a in(40,4496,6200,5456,3240,1188,720,228)*3:print((`a%6561/2178`+`a%2178/729`+`a%729/243`+`a%243/81`+`a%81/27`+`a%27/9`+`a%9/3`+`a%3/1`)*6).replace('0','\\').replace('1','/').replace('2',' ')

Edit

-9 due to @nedla2004 being more on the ball than me

-2 by taking the lambda outside of the loop and so losing 2 indent spaces

-1 by using in' '*3 instead of in 0,1,2 since I don't use h anyway. it's just a counter.

-3 Why, why, why did I leave a newline and 2 indents between the second for and the print??? It's late. Will revisit tomorrow.

-14 Can actually lose the lambda completely and just include the base 3 decoder directly after the print statement. Looks messy but after all, this is code golf :)

-4 No point setting a variable for the integer list. Just use it directly in the second for loop.

-14 and no point using the outer loop. Just multiply the integer tuple by 3 (shamelessly stolen from @nedla2004 to get under 200 :))

-3 Saved 3 by making \=0, /=1 and space=2. This makes the integer list shorter as three of the base 3 numbers now have leading 0's

How it works (and it does)

Since only 3 characters are used:

  1. l is a list of the 8 repeating patterns as integer equivalents of their base 3 representation assuming that " "=0, "\"=1 and "/"=2

  2. The lambda The first code after the print statement is a lightweight converter from integer to a base 3 string

  3. The first loop loops 3 times and the second prints each line with the base 3 characters multiplied by 6 and replaced with /,\ or space.

I'm sure I could use a regex instead of the nested replace() but I'm too tired to try right now. This was just an experiment and longer than my previous Python effort but have posted just for any comments on the approach (and also because I have never worked in base 3 before and I quite enjoyed working out the converter).

ElPedro

Posted 2016-11-08T17:51:30.740

Reputation: 5 301

1You could just remove the first division in the base 3 conversion. – nedla2004 – 2016-11-09T21:17:01.533

For some reason that was causing me problems earlier but just tried and it works now. many thanks for being more awake than me. I'll re-edit my answer (and you have just saved me 9 bytes :)) – ElPedro – 2016-11-09T21:20:42.423

1

I rewrote the base 3 conversion, it is no longer a lambda, I had to make it a function, but it might be able to be converted back to a lambda. You can find the function here.

– nedla2004 – 2016-11-09T21:47:15.883

Thanks. I think a combination of the two may work but that's probably a job for tomorrow evening :) Thanks again for your comments. – ElPedro – 2016-11-09T21:52:14.430

The function replaces the lambda, and that is all the complete code is here.

– nedla2004 – 2016-11-09T22:15:31.000

Just lost both the function and the lambda but will be looking at your code tomorrow. Thanks again. If I can get this under 200 I'll be happy with it. – ElPedro – 2016-11-09T22:31:13.463

1

I got it down to 169, here.

– nedla2004 – 2016-11-09T23:20:26.007

@nedla2004 I think that is different enough from mine that you should post it as your own solution. I have no problem with that. Nice work :) As I said, mine was just an idea that I threw out to the community. Nice effort for improving on it. – ElPedro – 2016-11-09T23:27:41.973

I think you mixed up the explanation, but the code is correct. – nedla2004 – 2016-11-10T19:51:10.387

Fixed. Got \ and / wrong way round – ElPedro – 2016-11-10T19:54:22.237

and apologies for stealing your *3. Just wanted to get below 200 :) – ElPedro – 2016-11-10T19:55:23.530

2

Ruby, 75 bytes

1152.times{|i|$><<"\\/ /\\\\ /"[(i+j=i/48)/4&1|(i-j)/2&2|j&4]+$/*(i%48/47)}

Better golfed, using a single 8-byte string lookup indexed by j&4 in addition to the other parameters, rather than a modifiable 4-byte string.

Ruby, 81 bytes

1152.times{|i|j=i/48%8;$><<"\\#{'/\\'[j/4]} /"[(i+j)/4&1|(i-j)/2&2]+$/*(i%48/47)}

Prints the diagonal stripes character by character. The correct character is selected from a string of 4 characters depending on the presence / absence of each strand. The overlap character is varied depending on which strand is on top.

Commented

1152.times{|i|j=i/48%8;        #Iterate through all printable chars. j is line number.
  $><<"\\#{'/\\'[j/4]} /"[     #Print a char from "\/ /" if j/4 even or "\\ /" if odd. character changes depending which strand on top.
   (i+j)/4&1|(i-j)/2&2]+       #Print \ if (i+j)/4==0, / if (i-j)/2&2 >0, space if both false. As above if both true. 
   $/*(i%48/47)                #If on column 47, print a newline.
}

Level River St

Posted 2016-11-08T17:51:30.740

Reputation: 22 049

2

05AB1E, 37 bytes

Uses CP-1252 encoding.

24FNU48FXXN+XN-<)8%3›J" \// \/\"è?}¶?

Try it online!

Explanation

Uses the mod-8 trick expertly explained in Jakube's pyth answer.

24F                                    # for N in [0 ... 23] do:
   NU                                  # save N in X
     48F                               # for N in [0 ... 48] do:
        XXN+XN-<)                      # push [X,X+N,X-N-1]
                 8%                    # mod each by 8
                   3›                  # compare with 3
                     J                 # join
                      " \// \/\"è?     # index into string and print
                                  }    # end inner loop
                                   ¶?  # print newline

Emigna

Posted 2016-11-08T17:51:30.740

Reputation: 50 798

2

Ruby, 135 bytes

puts [3320,1212,720,2172,6520,4144,2920,3184].map{|e|(e.to_s(3).rjust(8,"0").gsub("0"," ").gsub("1","\\").gsub("2","/"))*6+"\n"}.join*3

The number array corresponds to each component of each line, translated to base 3: = 0, \ = 1, /= 2, then converted to decimal. The gsub() calls are too big, though.

And, just now, I saw @ElPedro's answer. :-( Just coincidence.

jose_castro_arnaud

Posted 2016-11-08T17:51:30.740

Reputation: 229

e.to_s(3).rjust(8,"0")("%8s"%e.to_s(3)); gsub("0"," ").gsub("1","\\")..gsub("2","/")tr("013"," \\/"); "\n"$/; .join*"". You can also save a byte by dividing all of the numbers in the array by 4 and replacing e with (e*4). – Jordan – 2017-11-02T16:25:08.893

Oops, I guess that ought to be tr("021"," /\\"). – Jordan – 2017-11-02T16:31:11.643

1

PowerShell, 89 bytes

0..23|%{$y=$_
-join(48..94|%{('\/'[$y%8-lt4]+'\/ ')[(($_+$y)%8-lt4)+2*(($_-$y)%8-ge4)]})}

Try it online!

mazzy

Posted 2016-11-08T17:51:30.740

Reputation: 4 832

1

05AB1E, 29 bytes

•M;(Ч0—øθε;û…•…/\ Åв8ôJ6×3и»

Try it online!

Grimmy

Posted 2016-11-08T17:51:30.740

Reputation: 12 521

1

Python 2, 169 161 165 160 155 154 152

Based on @ElPedro's answer, with small improvements. To see the explanation, see their answer. This is Python 2, even though there seems to be parenthesis near the print.

Saved 8 bytes by using a variable for replace. That works only for strings, and using a function for it would be longer.

Saved 4 bytes by seeing that @ElPedro realized that they did not need l, and I did not either.

Saved 5 bytes by not flipping the range(8), and instead of using += to append to r, adding r to the end of the new digit. Try it using repl.it

Saved 5 bytes by stealing @ElPedro's new list of values.

Saved 1 byte by removing the space between the in and (.

Saved 2 bytes by removing the variable a.

for x in(40,4496,6200,5456,3240,1188,720,228)*3:
 r=''
 for i in range(8):r=`x/3**i%3`+r
 print(r*6).replace('0','\\').replace('1','/').replace('2',' ')

nedla2004

Posted 2016-11-08T17:51:30.740

Reputation: 521

You can save 1 by removing the space between in and the ( in the first for – ElPedro – 2016-11-10T10:21:08.277

Also I have lost three bytes by reordering the sequence of which numbers represent each character in the base 3 list. See my answer for explanation. feel free to copy. As far as I am concerned this one is a joint effort and I'm happy to see that my original idea had at least some potential :) – ElPedro – 2016-11-10T19:18:52.717

You don't need a=3**i. Just use for i in range(8):r=x/3**i%3+r to save a couple. operator precedence takes care of the rest :) – ElPedro – 2016-11-10T20:05:43.210

Not sure how to delimit the string conversion characters. The parser removed them in my last comment so don't just copy and paste from my suggestion or it will break :) – ElPedro – 2016-11-10T20:19:51.230

Good point, I understood. – nedla2004 – 2016-11-10T20:27:01.110

Here is a sneaky one to save 1 more - print r.replace('0','\\').replace('1','/').replace('2',' ')*6 (loses one bracket) – ElPedro – 2016-11-10T20:34:07.220

I think that's about as golfed as it gets. Enjoyed working with you on this one. Now it even looks like Python 2 :) – ElPedro – 2016-11-10T20:42:20.820

1

Haskell, 96 bytes

f n=n`mod`8`div`4
putStr$unlines[["\\ //\\ \\/"!!(f(x-y)+2*f(x+y)+4*f y)|x<-[0..47]]|y<-[0..23]]

Angs

Posted 2016-11-08T17:51:30.740

Reputation: 4 825

1

PHP, 184 bytes

<?$p=['1111////',' 11//// ','  ////  ',' ////11 ','////1111','1//  111','11    11','111  //1'];for($j=0;$j<3;$j++)for($i=0;$i<8;$i++)echo str_replace(1,'\\',str_repeat($p[$i],6))."\n";

Output:

C:\PHP>php make-me-a-blanket.php
\\\\////\\\\////\\\\////\\\\////\\\\////\\\\////
 \\////  \\////  \\////  \\////  \\////  \\//// 
  ////    ////    ////    ////    ////    ////  
 ////\\  ////\\  ////\\  ////\\  ////\\  ////\\ 
////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\
\//  \\\\//  \\\\//  \\\\//  \\\\//  \\\\//  \\\
\\    \\\\    \\\\    \\\\    \\\\    \\\\    \\
\\\  //\\\\  //\\\\  //\\\\  //\\\\  //\\\\  //\
\\\\////\\\\////\\\\////\\\\////\\\\////\\\\////
 \\////  \\////  \\////  \\////  \\////  \\//// 
  ////    ////    ////    ////    ////    ////  
 ////\\  ////\\  ////\\  ////\\  ////\\  ////\\ 
////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\
\//  \\\\//  \\\\//  \\\\//  \\\\//  \\\\//  \\\
\\    \\\\    \\\\    \\\\    \\\\    \\\\    \\
\\\  //\\\\  //\\\\  //\\\\  //\\\\  //\\\\  //\
\\\\////\\\\////\\\\////\\\\////\\\\////\\\\////
 \\////  \\////  \\////  \\////  \\////  \\//// 
  ////    ////    ////    ////    ////    ////  
 ////\\  ////\\  ////\\  ////\\  ////\\  ////\\ 
////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\
\//  \\\\//  \\\\//  \\\\//  \\\\//  \\\\//  \\\
\\    \\\\    \\\\    \\\\    \\\\    \\\\    \\
\\\  //\\\\  //\\\\  //\\\\  //\\\\  //\\\\  //\

Mario

Posted 2016-11-08T17:51:30.740

Reputation: 3 043

0

Batch, 152 bytes

@call:l
@call:l
:l
@for %%s in (\\\\//// " \\//// " "  ////  " " ////\\ " ////\\\\ "\//  \\\" "\\    \\" "\\\  //\")do @echo %%~s%%~s%%~s%%~s%%~s%%~s

String processing in Batch sucks, so this is probably the best approach. The call-and-fall-through is very slightly shorter than a nested for loop. At least I don't have to quote my backslashes!

Neil

Posted 2016-11-08T17:51:30.740

Reputation: 95 035

0

APL, 110 bytes

I'm new to APL, so this is a simplistic solution.

A←48⍴'\\\\////'⋄B←48⍴' \\//// '⋄C←48⍴'  ////  '⋄F←48⍴'\//  \\\'⋄G←48⍴'\\    \\'⋄24 48⍴A,B,C,(⊖B),(⊖A),F,G,⊖F  

Here's my approach: note that after the first 8 lines of the blanket, the pattern repeats itself. Therefore I only need to define the first 8 lines, and then I can repeat them 3 times. Also note that each line repeats itself after the first 8 characters. Therefore to define a single line I only need to define the first 8 characters and then repeat them 8 times.

Here's an ungolfed solution:

A←48⍴'\\\\////'⋄ ⍝ set A to a 48 element vector (48⍴) of repeated '\\\\////'s
B←48⍴' \\//// '⋄ ⍝ set B to a 48 element vector (48⍴) of repeated ' \\//// 's
C←48⍴'  ////  '⋄ ⍝ ...
D←48⍴' ////\\ '⋄ ⍝ Note that this is actually the reverse of vector B
E←48⍴'////\\\\'⋄ ⍝ Note that this is actually the reverse of vector A
F←48⍴'\//  \\\'⋄
G←48⍴'\\    \\'⋄
H←48⍴'\\\  //\'⋄ ⍝ Note that this is actually the reverse of vector F

24 48 ⍴ A,B,C,D,E,F,G,H ⍝ Make a 24 by 48 character matrix (24 48⍴) by concatenating A,B...H
                        ⍝ and repeating the string until the matrix is full

I noted above that D is the reverse of B, E is the revers of A, and H is the reverse of F. In my actual code, I take advantage of this by not defining D,F, or H and using the reverse function :

24 48⍴A,B,C,(⊖B),(⊖A),F,G,⊖F

ren

Posted 2016-11-08T17:51:30.740

Reputation: 189

0

Ruby, 132 bytes

puts Zlib.inflate Base64.decode64 "eJzt0bENADAMAsGeKdggC/3+cyQRC+A2ipuT3RgJgHWGUjm6VXb2Vjn/3KpJ/qtIPlp1v+XSKZKPVk3y/x5+D6/3sAEUXQ+Q"

very simple answer.

dkudriavtsev

Posted 2016-11-08T17:51:30.740

Reputation: 5 781