Ruby, 103 97 bytes
Thanks to Mitch Schwartz for a 6 byte improvement on the iterations.
a=(-7..7).map &:abs
a.map{|i|puts a.map{|j|(d=i%7-j%7)%4<1?'X d t DTDdDdDtT d'[i+j+d*d/3]:?.}*''}
A similar but significantly different approach to my original answer below. As before, we use the fact that a letter must be printed if i%7-j%7
is equal to 0 or 4. But here we store that difference in d
and use the formula i+j+d*d/3
to give an integer which is unique (up to symmetry) to that particular coloured square. Then we just look it up in the magic string.
Just for fun: C version of this approach, 120 bytes
z,i,j,d;f(){for(z=240;z--;)i=abs(z%16-8),j=abs(z/16-7),putchar(i-8?(d=i%7-j%7)%4?46:"X d t DTDdDdDtT d"[i+j+d*d/3]:10);}
Ruby, 115 113 bytes
2 bytes saved thanks to Value Ink.
(k=-7..7).map{|y|k.map{|x|i=x.abs;j=y.abs
$><<=(i%7-j%7)%4<1?"#{'XdTdT'[(i+j)/3]}dtDDDD"[[i%7,j%7].min]:?.}
puts}
Explanation
The origin is considered to be the centre of the board.
A letter must be printed if the x and y coordinates of the square have magnitudes that are identical or differ by 4. The only exceptions are on the outer edge of the board, but these follow the same pattern as the central row/column of the board, so we can use the same condition if we take the x and y coordinates modulo 7.
The choice of letter displayed is based on the coordinate of minimum magnitude. In this way the doubles and triples at (1,5) and (2,6) follow the same rule as at (1,1) and (2,2) and are obtained from the 7 character string "#{formula}dtDDDD"
This does not cover all variations for the edge and centreline squares, so the first character of the string is calculated from the formula 'XdTdT'[(i+j)/3]
.
(k=-7..7).map{|y|
k.map{|x|
i=x.abs;j=y.abs
print (i%7-j%7)%4<1? #IF this expression is true print a letter
"#{'XdTdT'[(i+j)/3] #select 1st character of magic string where [i%7,j%7].min==0
}dtDDDD"[[i%7,j%7].min]: #remaining 6 characters of magic string for diagonal
?. #ELSE print .
}
puts #at the end of the row print a newline
}
Why
X
and not*
to represent the star? :o – Fatalize – 2016-09-02T17:09:10.0176
*
is too high and mighty. – Calvin's Hobbies – 2016-09-02T17:09:52.350Why not
★
? :D – mbomb007 – 2016-09-02T21:46:23.0035
@mbomb007 Non-ASCII char in an ASCII-art challenge? Heresy!
– Luis Mendo – 2016-09-02T22:15:00.993