Belarus rushnyk

Clash Royale CLAN TAG#URR8PPP
up vote
14
down vote
favorite
We've got quite a few national flag challenges already:
AU
CH
FI
FR
GB
GB
IS
KR
NP
US...
Here's another, somewhat more advanced one:
Return or print the decorative pattern from Belarus's national flag as a matrix of two distinct values for red and white.

If your language doesn't support matrices, use a list of lists or the closest equivalent.
Extra whitespace is allowed on all sides.
The matrix can be transposed.
The elements can have a consistent separator, and so can the rows, e.g. output can be JSON.
You must use the 2012 version of the ornament pattern, not the 1951 or 1995 versions.
This is code-golf, so the shortest answer per language wins.
Sample output:
....###....#....###....
#..#####...#...#####..#
..###.###.....###.###..
.###...###...###...###.
###..#..###.###..#..###
.###...###...###...###.
..###.###.....###.###..
#..#####...#...#####..#
....###....#....###....
..#..#..#.....#..#..#..
.###...###...###...###.
##.##.##.##.##.##.##.##
.###...###...###...###.
..#..#..#.....#..#..#..
....###....#....###....
#..#####...#...#####..#
..#######.....#######..
.#########...#########.
#######################
####...#########...####
.#####..#######..#####.
..###....#####....###..
#..#....#######....#..#
.......####.####.......
#.....####...####.....#
##...####..#..####...##
###.####.......####.###
.######..#...#..######.
..####...##.##...####..
...###....###....###...
....##.#...#...#.##....
...###....###....###...
..####...##.##...####..
.######..#...#..######.
###.####.......####.###
##...####..#..####...##
#.....####...####.....#
.......####.####.......
#..#....#######....#..#
..###....#####....###..
.#####..#######..#####.
####...#########...####
#######################
.#########...#########.
..#######.....#######..
#..#####...#...#####..#
....###....#....###....
..#..#..#.....#..#..#..
.###...###...###...###.
##.##.##.##.##.##.##.##
.###...###...###...###.
..#..#..#.....#..#..#..
....###....#....###....
#..#####...#...#####..#
..###.###.....###.###..
.###...###...###...###.
###..#..###.###..#..###
.###...###...###...###.
..###.###.....###.###..
#..#####...#...#####..#
....###....#....###....
code-golf kolmogorov-complexity binary-matrix
add a comment |Â
up vote
14
down vote
favorite
We've got quite a few national flag challenges already:
AU
CH
FI
FR
GB
GB
IS
KR
NP
US...
Here's another, somewhat more advanced one:
Return or print the decorative pattern from Belarus's national flag as a matrix of two distinct values for red and white.

If your language doesn't support matrices, use a list of lists or the closest equivalent.
Extra whitespace is allowed on all sides.
The matrix can be transposed.
The elements can have a consistent separator, and so can the rows, e.g. output can be JSON.
You must use the 2012 version of the ornament pattern, not the 1951 or 1995 versions.
This is code-golf, so the shortest answer per language wins.
Sample output:
....###....#....###....
#..#####...#...#####..#
..###.###.....###.###..
.###...###...###...###.
###..#..###.###..#..###
.###...###...###...###.
..###.###.....###.###..
#..#####...#...#####..#
....###....#....###....
..#..#..#.....#..#..#..
.###...###...###...###.
##.##.##.##.##.##.##.##
.###...###...###...###.
..#..#..#.....#..#..#..
....###....#....###....
#..#####...#...#####..#
..#######.....#######..
.#########...#########.
#######################
####...#########...####
.#####..#######..#####.
..###....#####....###..
#..#....#######....#..#
.......####.####.......
#.....####...####.....#
##...####..#..####...##
###.####.......####.###
.######..#...#..######.
..####...##.##...####..
...###....###....###...
....##.#...#...#.##....
...###....###....###...
..####...##.##...####..
.######..#...#..######.
###.####.......####.###
##...####..#..####...##
#.....####...####.....#
.......####.####.......
#..#....#######....#..#
..###....#####....###..
.#####..#######..#####.
####...#########...####
#######################
.#########...#########.
..#######.....#######..
#..#####...#...#####..#
....###....#....###....
..#..#..#.....#..#..#..
.###...###...###...###.
##.##.##.##.##.##.##.##
.###...###...###...###.
..#..#..#.....#..#..#..
....###....#....###....
#..#####...#...#####..#
..###.###.....###.###..
.###...###...###...###.
###..#..###.###..#..###
.###...###...###...###.
..###.###.....###.###..
#..#####...#...#####..#
....###....#....###....
code-golf kolmogorov-complexity binary-matrix
add a comment |Â
up vote
14
down vote
favorite
up vote
14
down vote
favorite
We've got quite a few national flag challenges already:
AU
CH
FI
FR
GB
GB
IS
KR
NP
US...
Here's another, somewhat more advanced one:
Return or print the decorative pattern from Belarus's national flag as a matrix of two distinct values for red and white.

If your language doesn't support matrices, use a list of lists or the closest equivalent.
Extra whitespace is allowed on all sides.
The matrix can be transposed.
The elements can have a consistent separator, and so can the rows, e.g. output can be JSON.
You must use the 2012 version of the ornament pattern, not the 1951 or 1995 versions.
This is code-golf, so the shortest answer per language wins.
Sample output:
....###....#....###....
#..#####...#...#####..#
..###.###.....###.###..
.###...###...###...###.
###..#..###.###..#..###
.###...###...###...###.
..###.###.....###.###..
#..#####...#...#####..#
....###....#....###....
..#..#..#.....#..#..#..
.###...###...###...###.
##.##.##.##.##.##.##.##
.###...###...###...###.
..#..#..#.....#..#..#..
....###....#....###....
#..#####...#...#####..#
..#######.....#######..
.#########...#########.
#######################
####...#########...####
.#####..#######..#####.
..###....#####....###..
#..#....#######....#..#
.......####.####.......
#.....####...####.....#
##...####..#..####...##
###.####.......####.###
.######..#...#..######.
..####...##.##...####..
...###....###....###...
....##.#...#...#.##....
...###....###....###...
..####...##.##...####..
.######..#...#..######.
###.####.......####.###
##...####..#..####...##
#.....####...####.....#
.......####.####.......
#..#....#######....#..#
..###....#####....###..
.#####..#######..#####.
####...#########...####
#######################
.#########...#########.
..#######.....#######..
#..#####...#...#####..#
....###....#....###....
..#..#..#.....#..#..#..
.###...###...###...###.
##.##.##.##.##.##.##.##
.###...###...###...###.
..#..#..#.....#..#..#..
....###....#....###....
#..#####...#...#####..#
..###.###.....###.###..
.###...###...###...###.
###..#..###.###..#..###
.###...###...###...###.
..###.###.....###.###..
#..#####...#...#####..#
....###....#....###....
code-golf kolmogorov-complexity binary-matrix
We've got quite a few national flag challenges already:
AU
CH
FI
FR
GB
GB
IS
KR
NP
US...
Here's another, somewhat more advanced one:
Return or print the decorative pattern from Belarus's national flag as a matrix of two distinct values for red and white.

If your language doesn't support matrices, use a list of lists or the closest equivalent.
Extra whitespace is allowed on all sides.
The matrix can be transposed.
The elements can have a consistent separator, and so can the rows, e.g. output can be JSON.
You must use the 2012 version of the ornament pattern, not the 1951 or 1995 versions.
This is code-golf, so the shortest answer per language wins.
Sample output:
....###....#....###....
#..#####...#...#####..#
..###.###.....###.###..
.###...###...###...###.
###..#..###.###..#..###
.###...###...###...###.
..###.###.....###.###..
#..#####...#...#####..#
....###....#....###....
..#..#..#.....#..#..#..
.###...###...###...###.
##.##.##.##.##.##.##.##
.###...###...###...###.
..#..#..#.....#..#..#..
....###....#....###....
#..#####...#...#####..#
..#######.....#######..
.#########...#########.
#######################
####...#########...####
.#####..#######..#####.
..###....#####....###..
#..#....#######....#..#
.......####.####.......
#.....####...####.....#
##...####..#..####...##
###.####.......####.###
.######..#...#..######.
..####...##.##...####..
...###....###....###...
....##.#...#...#.##....
...###....###....###...
..####...##.##...####..
.######..#...#..######.
###.####.......####.###
##...####..#..####...##
#.....####...####.....#
.......####.####.......
#..#....#######....#..#
..###....#####....###..
.#####..#######..#####.
####...#########...####
#######################
.#########...#########.
..#######.....#######..
#..#####...#...#####..#
....###....#....###....
..#..#..#.....#..#..#..
.###...###...###...###.
##.##.##.##.##.##.##.##
.###...###...###...###.
..#..#..#.....#..#..#..
....###....#....###....
#..#####...#...#####..#
..###.###.....###.###..
.###...###...###...###.
###..#..###.###..#..###
.###...###...###...###.
..###.###.....###.###..
#..#####...#...#####..#
....###....#....###....
code-golf kolmogorov-complexity binary-matrix
asked 13 hours ago
ngn
6,42512153
6,42512153
add a comment |Â
add a comment |Â
6 Answers
6
active
oldest
votes
up vote
6
down vote
Stax, 68 bytes
àÃÂãâÂÂiâÂÂ7FF3xìåâ«YbâÂÂtâ¤yâ¡õÃ¥è0âÂÂâÂÂhâÂÂÃÂDOüâÂÂ`âÂÂâ ^>âÂÂ;âÂÂÃÂ9âÂÂçÃÂü$ÃÂâ¡â«èj_âÂÂ;ø;áòéâºâÂÂ4!PâÂÂ
Run and debug it
Outputs vertical version, 1 for white, 0 for red. Naive approach: compress top left quarter, then complete.
add a comment |Â
up vote
3
down vote
Python 2, 183 181 bytes
S=[bin(int(''.join(w),36))[2:].rjust(31,'0')for w in zip(*[iter("RBRG5FDLAJ2O77MSE012OBJWJUSWDQ464UKNYZIE8JYGS0JRFOCIJY7U5F983X0LYW20WNTE")]*6)]
for s in S[:0:-1]+S:print s[:0:-1]+s
Try it online!
Outputs transposed version, using 0 and 1 for white and red.
add a comment |Â
up vote
2
down vote
Charcoal, 93 89 87 83 bytes
âÂÂÂ
up vote
2
down vote
JavaScript (ES6), 164 bytes
Transposed output. Uses 0 for white, 1 for red.
f=(x=y=0)=>y<61?x>22?`
`+f(!++y):(-~'o`xb[FMMf[MM[Fxbo`cCMMZZMMcCo`xbFN~~N}{[wH?]@NbfvBHWwooa'.charCodeAt((y>30?60-y:y)*2+(X=x>11?22-x:x)/6)>>X%6&1)+f(x+1):''
Try it online! (prettified output)
Using Buffer() in Node.js saves 1 byte.
add a comment |Â
up vote
0
down vote
SOGL V0.12, 61 56 bytes
âÂÂñâ¶U-â¼ðjÃ
ÂIä$ãçÃÂâÂÂFVþÃÂâÂ
Â{VqMâ¼ÿYà!âÂÂÿéÃÂ.ÃÂgñâÂÂöã,Cyâ²âÂÂâÂÂ2âÂÂñ6ënâ¬,
Try it Here!
add a comment |Â
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
Stax, 68 bytes
àÃÂãâÂÂiâÂÂ7FF3xìåâ«YbâÂÂtâ¤yâ¡õÃ¥è0âÂÂâÂÂhâÂÂÃÂDOüâÂÂ`âÂÂâ ^>âÂÂ;âÂÂÃÂ9âÂÂçÃÂü$ÃÂâ¡â«èj_âÂÂ;ø;áòéâºâÂÂ4!PâÂÂ
Run and debug it
Outputs vertical version, 1 for white, 0 for red. Naive approach: compress top left quarter, then complete.
add a comment |Â
up vote
6
down vote
Stax, 68 bytes
àÃÂãâÂÂiâÂÂ7FF3xìåâ«YbâÂÂtâ¤yâ¡õÃ¥è0âÂÂâÂÂhâÂÂÃÂDOüâÂÂ`âÂÂâ ^>âÂÂ;âÂÂÃÂ9âÂÂçÃÂü$ÃÂâ¡â«èj_âÂÂ;ø;áòéâºâÂÂ4!PâÂÂ
Run and debug it
Outputs vertical version, 1 for white, 0 for red. Naive approach: compress top left quarter, then complete.
add a comment |Â
up vote
6
down vote
up vote
6
down vote
Stax, 68 bytes
àÃÂãâÂÂiâÂÂ7FF3xìåâ«YbâÂÂtâ¤yâ¡õÃ¥è0âÂÂâÂÂhâÂÂÃÂDOüâÂÂ`âÂÂâ ^>âÂÂ;âÂÂÃÂ9âÂÂçÃÂü$ÃÂâ¡â«èj_âÂÂ;ø;áòéâºâÂÂ4!PâÂÂ
Run and debug it
Outputs vertical version, 1 for white, 0 for red. Naive approach: compress top left quarter, then complete.
Stax, 68 bytes
àÃÂãâÂÂiâÂÂ7FF3xìåâ«YbâÂÂtâ¤yâ¡õÃ¥è0âÂÂâÂÂhâÂÂÃÂDOüâÂÂ`âÂÂâ ^>âÂÂ;âÂÂÃÂ9âÂÂçÃÂü$ÃÂâ¡â«èj_âÂÂ;ø;áòéâºâÂÂ4!PâÂÂ
Run and debug it
Outputs vertical version, 1 for white, 0 for red. Naive approach: compress top left quarter, then complete.
answered 12 hours ago
wastl
1,844424
1,844424
add a comment |Â
add a comment |Â
up vote
3
down vote
Python 2, 183 181 bytes
S=[bin(int(''.join(w),36))[2:].rjust(31,'0')for w in zip(*[iter("RBRG5FDLAJ2O77MSE012OBJWJUSWDQ464UKNYZIE8JYGS0JRFOCIJY7U5F983X0LYW20WNTE")]*6)]
for s in S[:0:-1]+S:print s[:0:-1]+s
Try it online!
Outputs transposed version, using 0 and 1 for white and red.
add a comment |Â
up vote
3
down vote
Python 2, 183 181 bytes
S=[bin(int(''.join(w),36))[2:].rjust(31,'0')for w in zip(*[iter("RBRG5FDLAJ2O77MSE012OBJWJUSWDQ464UKNYZIE8JYGS0JRFOCIJY7U5F983X0LYW20WNTE")]*6)]
for s in S[:0:-1]+S:print s[:0:-1]+s
Try it online!
Outputs transposed version, using 0 and 1 for white and red.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Python 2, 183 181 bytes
S=[bin(int(''.join(w),36))[2:].rjust(31,'0')for w in zip(*[iter("RBRG5FDLAJ2O77MSE012OBJWJUSWDQ464UKNYZIE8JYGS0JRFOCIJY7U5F983X0LYW20WNTE")]*6)]
for s in S[:0:-1]+S:print s[:0:-1]+s
Try it online!
Outputs transposed version, using 0 and 1 for white and red.
Python 2, 183 181 bytes
S=[bin(int(''.join(w),36))[2:].rjust(31,'0')for w in zip(*[iter("RBRG5FDLAJ2O77MSE012OBJWJUSWDQ464UKNYZIE8JYGS0JRFOCIJY7U5F983X0LYW20WNTE")]*6)]
for s in S[:0:-1]+S:print s[:0:-1]+s
Try it online!
Outputs transposed version, using 0 and 1 for white and red.
edited 11 hours ago
answered 11 hours ago
TFeld
10.2k1832
10.2k1832
add a comment |Â
add a comment |Â
up vote
2
down vote
Charcoal, 93 89 87 83 bytes
âÂÂâÂÂâ·Bâ¦Âcï¼³ÃÂ$ækCâÂÂAâÂÂâ§õ&ÃÂtÃÂú@ï¼Ârâ´ëÃÂwöâ¶dâ§êâ§#kï½Ââ·âÂÂâ§ôëÃÂâÂÂÿTKâÂÂ<âÂÂâ§Dâ¹QÃÂçMôi9vâ¶âÂÂâ¨â§a÷BÉÂÂæBâÂÂXâÂÂâÂÂï¼¢âÂÂâÂÂ
My first charcoal answer! :D
Try it online!
Saved 4 bytes by outputting the design horizontally rather than vertically (fewer newlines).
Thanks to @Neil for saving 6 bytes.
answered 2 hours ago
Lynn
47.7k693221
47.7k693221
add a comment |Â
add a comment |Â
up vote
0
down vote
SOGL V0.12, 61 56 bytes
âÂÂñâ¶U-â¼ðjÃ
ÂIä$ãçÃÂâÂÂFVþÃÂâÂ
Â{VqMâ¼ÿYà!âÂÂÿéÃÂ.ÃÂgñâÂÂöã,Cyâ²âÂÂâÂÂ2âÂÂñ6ënâ¬,
Try it Here!
add a comment |Â
up vote
0
down vote
SOGL V0.12, 61 56 bytes
âÂÂñâ¶U-â¼ðjÃ
ÂIä$ãçÃÂâÂÂFVþÃÂâÂ
Â{VqMâ¼ÿYà!âÂÂÿéÃÂ.ÃÂgñâÂÂöã,Cyâ²âÂÂâÂÂ2âÂÂñ6ënâ¬,
Try it Here!
add a comment |Â
up vote
0
down vote
up vote
0
down vote
SOGL V0.12, 61 56 bytes
âÂÂñâ¶U-â¼ðjÃ
ÂIä$ãçÃÂâÂÂFVþÃÂâÂ
Â{VqMâ¼ÿYà!âÂÂÿéÃÂ.ÃÂgñâÂÂöã,Cyâ²âÂÂâÂÂ2âÂÂñ6ënâ¬,
Try it Here!
SOGL V0.12, 61 56 bytes
âÂÂñâ¶U-â¼ðjÃ
ÂIä$ãçÃÂâÂÂFVþÃÂâÂ
Â{VqMâ¼ÿYà!âÂÂÿéÃÂ.ÃÂgñâÂÂöã,Cyâ²âÂÂâÂÂ2âÂÂñ6ënâ¬,
Try it Here!
edited 14 mins ago
answered 31 mins ago
dzaima
12.1k11450
12.1k11450
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f170053%2fbelarus-rushnyk%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password