Skip to main content
added 2 characters in body
Source Link
Ted
  • 2.4k
  • 7
  • 33

Python 3.8 (pre-release)Python 3, 182229 179 bytes

def f(n):[print("".join(" ║═╔║║╗╦═╚═╠╝╩╣╬"[int("".join║═╔║║╗╦═╚═╠╝╩╣╬"[sum(str(+n*4!=c,2*(b>0)n*2!=r)for,c band in(r%2,c%44,r,c and 8,n*2-rc%4and 16,n*4-c)r%2*32),2)%21]for c in range(n*4+1)))for r in range(n*2+1)]

Try it online!Try it online!

  • 23 bytes saved @emanresuA

Explanation

In essence, we iterate through all the rows an columns (of the character grid, not of the box grid), denoted by r and c.

We define some checks for each cell:

sum(r%2,c%4(n*4!=c,r2*(n*2!=r),c and 4,r-n*2 and 8,c-n*4c%4and 16,r%2*32))

These will eitherare designed to each be truthy or falsy depending on the row and column. This is then converted as if the booleans were bits into a number1 bit worth of information, so when summed they don't affect eachother. Then we modulo the whole thing by 21, which gives us the smallest resulting domain of numbers without causing collisions between characters (found by exhaustive search).

Then we lookup the resulting value in the string " ║═╔║║╗╦═╚═╠╝╩╣╬"

Here's the code for finding the lookup string.

Python 3.8 (pre-release), 182 bytes

def f(n):[print("".join(" ║═╔║║╗╦═╚═╠╝╩╣╬"[int("".join(str(+(b>0))for b in(r%2,c%4,r,c,n*2-r,n*4-c)),2)%21]for c in range(n*4+1)))for r in range(n*2+1)]

Try it online!

  • 23 bytes saved @emanresuA

Explanation

In essence, we iterate through all the rows an columns (of the character grid, not of the box grid), denoted by r and c.

We define some checks for each cell:

(r%2,c%4,r,c,r-n*2,c-n*4)

These will either be truthy or falsy depending on the row and column. This is then converted as if the booleans were bits into a number. Then we modulo the whole thing by 21, which gives us the smallest resulting domain of numbers without causing collisions between characters (found by exhaustive search).

Then we lookup the resulting value in the string " ║═╔║║╗╦═╚═╠╝╩╣╬"

Here's the code for finding the lookup string.

Python 3, 229 179 bytes

def f(n):[print("".join(" ║═╔║║╗╦═╚═╠╝╩╣╬"[sum((n*4!=c,2*(n*2!=r),c and 4,r and 8,c%4and 16,r%2*32))%21]for c in range(n*4+1)))for r in range(n*2+1)]

Try it online!

  • 23 bytes saved @emanresuA

Explanation

In essence, we iterate through all the rows an columns (of the character grid, not of the box grid), denoted by r and c.

We define some checks for each cell:

sum((n*4!=c,2*(n*2!=r),c and 4,r and 8,c%4and 16,r%2*32))

These are designed to each be 1 bit worth of information, so when summed they don't affect eachother. Then we modulo the whole thing by 21, which gives us the smallest resulting domain of numbers without causing collisions between characters (found by exhaustive search).

Then we lookup the resulting value in the string " ║═╔║║╗╦═╚═╠╝╩╣╬"

Here's the code for finding the lookup string.

added 1 character in body
Source Link
Ted
  • 2.4k
  • 7
  • 33

Python 3.8 (pre-release), 184182 bytes

def f(n):[print("".join(" ║═╔║║╗╦═╚═╠╝╩╣╬"[int("".join(b and"1"or"0"forstr(+(b>0))for b in(r%2,c%4,r,c,r-n*2,c-r,n*4-c)),2)%21]for c in range(n*4+1)))for r in range(n*2+1)]

Try it online!Try it online!

  • 23 bytes saved @emanresuA

Explanation

In essence, we iterate through all the rows an columns (of the character grid, not of the box grid), denoted by r and c.

We define some checks for each cell:

(r%2,c%4,r,c,r-n*2,c-n*4)

These will either be truthy or falsy depending on the row and column. This is then converted as if the booleans were bits into a number. Then we modulo the whole thing by 21, which gives us the smallest resulting domain of numbers without causing collisions between characters (found by exhaustive search).

Then we lookup the resulting value in the string " ║═╔║║╗╦═╚═╠╝╩╣╬"

Here's the code for finding the lookup string.

Python 3.8 (pre-release), 184 bytes

def f(n):[print("".join(" ║═╔║║╗╦═╚═╠╝╩╣╬"[int("".join(b and"1"or"0"for b in(r%2,c%4,r,c,r-n*2,c-n*4)),2)%21]for c in range(n*4+1)))for r in range(n*2+1)]

Try it online!

  • 23 bytes saved @emanresuA

Explanation

In essence, we iterate through all the rows an columns (of the character grid, not of the box grid), denoted by r and c.

We define some checks for each cell:

(r%2,c%4,r,c,r-n*2,c-n*4)

These will either be truthy or falsy depending on the row and column. This is then converted as if the booleans were bits into a number. Then we modulo the whole thing by 21, which gives us the smallest resulting domain of numbers without causing collisions between characters (found by exhaustive search).

Then we lookup the resulting value in the string " ║═╔║║╗╦═╚═╠╝╩╣╬"

Here's the code for finding the lookup string.

Python 3.8 (pre-release), 182 bytes

def f(n):[print("".join(" ║═╔║║╗╦═╚═╠╝╩╣╬"[int("".join(str(+(b>0))for b in(r%2,c%4,r,c,n*2-r,n*4-c)),2)%21]for c in range(n*4+1)))for r in range(n*2+1)]

Try it online!

  • 23 bytes saved @emanresuA

Explanation

In essence, we iterate through all the rows an columns (of the character grid, not of the box grid), denoted by r and c.

We define some checks for each cell:

(r%2,c%4,r,c,r-n*2,c-n*4)

These will either be truthy or falsy depending on the row and column. This is then converted as if the booleans were bits into a number. Then we modulo the whole thing by 21, which gives us the smallest resulting domain of numbers without causing collisions between characters (found by exhaustive search).

Then we lookup the resulting value in the string " ║═╔║║╗╦═╚═╠╝╩╣╬"

Here's the code for finding the lookup string.

Rollback to Revision 6
Source Link
Ted
  • 2.4k
  • 7
  • 33

PythonPython 3.8 (pre-release), 154184 bytes (SBCS)

  
def f(n):[print("".join(" ║═╔║║╗╦═╚═╠╝╩╣╬"[int("".join(b and"1"or"0"for b in(r%2,c%4,r,c,r-n*2,c-n*4)),2)%21]for c in range(n*4+1)))for r in range(n*2+1)]

Attempt This Online!Try it online!

  • 23 bytes saved @emanresuA

Explanation

In essence, we iterate through all the rows an columns (of the character grid, not of the box grid), denoted by r and c.

We define some checks for each cell:

(r%2,c%4,r,c,r-n*2,c-n*4)
(r%2,c%4,r,c,r-n*2,c-n*4)

These will either be truthy or falsy depending on the row and column. This is then converted as if the booleans were bits into a number. Then we modulo the whole thing by 21, which gives us the smallest resulting domain of numbers without causing collisions between characters (found by exhaustive search).

Then we lookup the resulting value in the string " ║═╔║║╗╦═╚═╠╝╩╣╬"

Here's the code for finding the lookup string.

Python, 154 bytes (SBCS)

 
def f(n):[print("".join(" ║═╔║║╗╦═╚═╠╝╩╣╬"[int("".join(b and"1"or"0"for b in(r%2,c%4,r,c,r-n*2,c-n*4)),2)%21]for c in range(n*4+1)))for r in range(n*2+1)]

Attempt This Online!

  • 23 bytes saved @emanresuA

Explanation

In essence, we iterate through all the rows an columns (of the character grid, not of the box grid), denoted by r and c.

We define some checks for each cell:

(r%2,c%4,r,c,r-n*2,c-n*4)

These will either be truthy or falsy depending on the row and column. This is then converted as if the booleans were bits into a number. Then we modulo the whole thing by 21, which gives us the smallest resulting domain of numbers without causing collisions between characters (found by exhaustive search).

Then we lookup the resulting value in the string " ║═╔║║╗╦═╚═╠╝╩╣╬"

Here's the code for finding the lookup string.

Python 3.8 (pre-release), 184 bytes

 
def f(n):[print("".join(" ║═╔║║╗╦═╚═╠╝╩╣╬"[int("".join(b and"1"or"0"for b in(r%2,c%4,r,c,r-n*2,c-n*4)),2)%21]for c in range(n*4+1)))for r in range(n*2+1)]

Try it online!

  • 23 bytes saved @emanresuA

Explanation

In essence, we iterate through all the rows an columns (of the character grid, not of the box grid), denoted by r and c.

We define some checks for each cell:

(r%2,c%4,r,c,r-n*2,c-n*4)

These will either be truthy or falsy depending on the row and column. This is then converted as if the booleans were bits into a number. Then we modulo the whole thing by 21, which gives us the smallest resulting domain of numbers without causing collisions between characters (found by exhaustive search).

Then we lookup the resulting value in the string " ║═╔║║╗╦═╚═╠╝╩╣╬"

Here's the code for finding the lookup string.

deleted 102 characters in body
Source Link
Ted
  • 2.4k
  • 7
  • 33
Loading
added 3 characters in body
Source Link
Ted
  • 2.4k
  • 7
  • 33
Loading
deleted 13 characters in body
Source Link
Ted
  • 2.4k
  • 7
  • 33
Loading
deleted 39 characters in body
Source Link
Ted
  • 2.4k
  • 7
  • 33
Loading
added 560 characters in body
Source Link
Ted
  • 2.4k
  • 7
  • 33
Loading
deleted 22 characters in body
Source Link
Ted
  • 2.4k
  • 7
  • 33
Loading
Source Link
Ted
  • 2.4k
  • 7
  • 33
Loading