Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

-2 bytes by using actual bytestrings and reemploying the %12.
Source Link
squareroot12621
  • 1.2k
  • 1
  • 3
  • 18

Python 3.8 (pre-release), (削除) 538 (削除ここまで) (削除) 478 (削除ここまで) (削除) 459 (削除ここまで) (削除) 441 (削除ここまで) 440(削除) 440 (削除ここまで) 438 bytes

-60 bytes by compressing some strings of characters in the die string.
-18 bytes by emanresu A.
-1 more byte by reducing 2*(c>3) to c//4*2.
-18 bytes by using not-quite-bytestrings-but-close-enough.
-1 byte by eliminating the need for the %12.
-2 bytes by using actual bytestrings and reemploying the%12.

from random import*
R=randrange
S=str.replace
P=lambda s:f'{ord("ŅŕLJ"(TŅŕŭ‚đ"[n[s]-9]TŅŕŭ‚đŅŕLJ"[n[s]%12]):09b}'.translate(' o'*50)
c=R(8)
n=[3,*[0,1,5,4,0][c%4*b''[c%4:][:2],2+c%2*6][::1-c//4*2]
for _ in[0]*R(3):n[1:]=[n[3]+6,n[1]+6,n[2]]
print(((S(S(S(""" .B.
 /A/|
 /A/}{|
 /A/}{ |
:B:}{ }{|
|A| }{ |
C }{:
|A| }{/
C/
|A|/
'B'""",'A',' %s %s %s '),'B','-'*11),'C','|'+' '*11+'|}{')%(*P(3)+P(1),))[::-1].format(*(a:=P(2))[6:]+a[3:6]+a[:3]))[::-1])

I've been banging my head against this problem for about 2 hours now (new record!). Thankfully, the byte count wenthas gone down around 100 bytes from the original submission.
...Is that a good thing?

Try it online! Try it online!

Python 3.8 (pre-release), (削除) 538 (削除ここまで) (削除) 478 (削除ここまで) (削除) 459 (削除ここまで) (削除) 441 (削除ここまで) 440 bytes

-60 bytes by compressing some strings of characters in the die string.
-18 bytes by emanresu A.
-1 more byte by reducing 2*(c>3) to c//4*2.
-18 bytes by using not-quite-bytestrings-but-close-enough.
-1 byte by eliminating the need for the %12.

from random import*
R=randrange
S=str.replace
P=lambda s:f'{ord("ŅŕLJ(TŅŕŭ‚đ"[n[s]-9]):09b}'.translate(' o'*50)
c=R(8)
n=[3,*[0,1,5,4,0][c%4:][:2],2+c%2*6][::1-c//4*2]
for _ in[0]*R(3):n[1:]=[n[3]+6,n[1]+6,n[2]]
print(((S(S(S(""" .B.
 /A/|
 /A/}{|
 /A/}{ |
:B:}{ }{|
|A| }{ |
C }{:
|A| }{/
C/
|A|/
'B'""",'A',' %s %s %s '),'B','-'*11),'C','|'+' '*11+'|}{')%(*P(3)+P(1),))[::-1].format(*(a:=P(2))[6:]+a[3:6]+a[:3]))[::-1])

I've been banging my head against this problem for about 2 hours now (new record!). Thankfully, the byte count went down around 100 bytes from the original submission.
...Is that a good thing?

Try it online!

Python 3.8 (pre-release), (削除) 538 (削除ここまで) (削除) 478 (削除ここまで) (削除) 459 (削除ここまで) (削除) 441 (削除ここまで) (削除) 440 (削除ここまで) 438 bytes

-60 bytes by compressing some strings of characters in the die string.
-18 bytes by emanresu A.
-1 more byte by reducing 2*(c>3) to c//4*2.
-18 bytes by using not-quite-bytestrings-but-close-enough.
-1 byte by eliminating the need for the %12.
-2 bytes by using actual bytestrings and reemploying the%12.

from random import*
R=randrange
S=str.replace
P=lambda s:f'{ord("(TŅŕŭ‚đŅŕLJ"[n[s]%12]):09b}'.translate(' o'*50)
c=R(8)
n=[3,*b''[c%4:][:2],2+c%2*6][::1-c//4*2]
for _ in[0]*R(3):n[1:]=[n[3]+6,n[1]+6,n[2]]
print(((S(S(S(""" .B.
 /A/|
 /A/}{|
 /A/}{ |
:B:}{ }{|
|A| }{ |
C }{:
|A| }{/
C/
|A|/
'B'""",'A',' %s %s %s '),'B','-'*11),'C','|'+' '*11+'|}{')%(*P(3)+P(1),))[::-1].format(*(a:=P(2))[6:]+a[3:6]+a[:3]))[::-1])

I've been banging my head against this problem for about 2 hours now (new record!). Thankfully, the byte count has gone down 100 bytes from the original submission.
...Is that a good thing?

Try it online!

-1 byte by eliminating the need for the %12.
Source Link
squareroot12621
  • 1.2k
  • 1
  • 3
  • 18

Python 3.8 (pre-release), (削除) 538 (削除ここまで) (削除) 478 (削除ここまで) (削除) 459 (削除ここまで) 441(削除) 441 (削除ここまで) 440 bytes

-60 bytes by compressing some strings of characters in the die string.
-18 bytes by emanresu A.
-1 more byte by reducing 2*(c>3) to c//4*2.
-18 bytes by using not-quite-bytestrings-but-close-enough.
-1 byte by eliminating the need for the%12.

from random import*
R=randrange
S=str.replace
P=lambda s:f'{ord(""ŅŕLJ(TŅŕŭ‚đŅŕLJ"[n[s]%12]TŅŕŭ‚đ"[n[s]-9]):09b}'.translate(' o'*50)
c=R(8)
n=[3,*[0,1,5,4,0][c%4:][:2],2+c%2*6][::1-c//4*2]
for _ in[0]*R(3):n[1:]=[n[3]+6,n[1]+6,n[2]]
print(((S(S(S(""" .B.
 /A/|
 /A/}{|
 /A/}{ |
:B:}{ }{|
|A| }{ |
C }{:
|A| }{/
C/
|A|/
'B'""",'A',' %s %s %s '),'B','-'*11),'C','|'+' '*11+'|}{')%(*P(3)+P(1),))[::-1].format(*(a:=P(2))[6:]+a[3:6]+a[:3]))[::-1])

I've been banging my head against this problem for about 2 hours now (new record!). Thankfully, the byte count went down around 100 bytes from the original submission.
...Is that a good thing?

Try it online! Try it online!

Python 3.8 (pre-release), (削除) 538 (削除ここまで) (削除) 478 (削除ここまで) (削除) 459 (削除ここまで) 441 bytes

-60 bytes by compressing some strings of characters in the die string.
-18 bytes by emanresu A.
-1 more byte by reducing 2*(c>3) to c//4*2.
-18 bytes by using not-quite-bytestrings-but-close-enough.

from random import*
R=randrange
S=str.replace
P=lambda s:f'{ord("(TŅŕŭ‚đŅŕLJ"[n[s]%12]):09b}'.translate(' o'*50)
c=R(8)
n=[3,*[0,1,5,4,0][c%4:][:2],2+c%2*6][::1-c//4*2]
for _ in[0]*R(3):n[1:]=[n[3]+6,n[1]+6,n[2]]
print(((S(S(S(""" .B.
 /A/|
 /A/}{|
 /A/}{ |
:B:}{ }{|
|A| }{ |
C }{:
|A| }{/
C/
|A|/
'B'""",'A',' %s %s %s '),'B','-'*11),'C','|'+' '*11+'|}{')%(*P(3)+P(1),))[::-1].format(*(a:=P(2))[6:]+a[3:6]+a[:3]))[::-1])

I've been banging my head against this problem for about 2 hours now (new record!). Thankfully, the byte count went down around 100 bytes from the original submission.
...Is that a good thing?

Try it online!

Python 3.8 (pre-release), (削除) 538 (削除ここまで) (削除) 478 (削除ここまで) (削除) 459 (削除ここまで) (削除) 441 (削除ここまで) 440 bytes

-60 bytes by compressing some strings of characters in the die string.
-18 bytes by emanresu A.
-1 more byte by reducing 2*(c>3) to c//4*2.
-18 bytes by using not-quite-bytestrings-but-close-enough.
-1 byte by eliminating the need for the%12.

from random import*
R=randrange
S=str.replace
P=lambda s:f'{ord("ŅŕLJ(TŅŕŭ‚đ"[n[s]-9]):09b}'.translate(' o'*50)
c=R(8)
n=[3,*[0,1,5,4,0][c%4:][:2],2+c%2*6][::1-c//4*2]
for _ in[0]*R(3):n[1:]=[n[3]+6,n[1]+6,n[2]]
print(((S(S(S(""" .B.
 /A/|
 /A/}{|
 /A/}{ |
:B:}{ }{|
|A| }{ |
C }{:
|A| }{/
C/
|A|/
'B'""",'A',' %s %s %s '),'B','-'*11),'C','|'+' '*11+'|}{')%(*P(3)+P(1),))[::-1].format(*(a:=P(2))[6:]+a[3:6]+a[:3]))[::-1])

I've been banging my head against this problem for about 2 hours now (new record!). Thankfully, the byte count went down around 100 bytes from the original submission.
...Is that a good thing?

Try it online!

-18 bytes by using not-quite-bytestrings-but-close-enough.
Source Link
squareroot12621
  • 1.2k
  • 1
  • 3
  • 18

Python 3.8 (pre-release), (削除) 538 (削除ここまで) (削除) 478 (削除ここまで) 459(削除) 459 (削除ここまで) 441 bytes

-60 bytes by compressing some strings of characters in the die string.
-18 bytes by emanresu A.
-1 more byte by reducing 2*(c>3) to c//4*2.
-18 bytes by using not-quite-bytestrings-but-close-enough.

from random import*
R=randrange
S=str.replace
P=lambda s:f'{[16,40,84,325,341,365,16,130,273,325,341,455][n[s]%12]ord("(TŅŕŭ‚đŅŕLJ"[n[s]%12]):09b}'.translate(' o'*50)
c=R(8)
n=[3,*[0,1,5,4,0][c%4:][:2],2+c%2*6][::1-c//4*2]
for _ in[0]*R(3):n[1:]=[n[3]+6,n[1]+6,n[2]]
print(((S(S(S("""""" .B.
 /A/|
 /A/}{|
 /A/}{ |
:B:}{ }{|
|A| }{ |
C }{:
|A| }{/
C/
|A|/
'B'"""'B'""",'A',' %s %s %s '),'B','-'*11),'C','|'+' '*11+'|}{')%(*P(3)+P(1),))[::-1].format(*(a:=P(2))[6:]+a[3:6]+a[:3]))[::-1])

I've been banging my head against this problem for about 2 hours now (new record!). ExpectThankfully, the (削除) 538 (削除ここまで)(削除) 478 (削除ここまで) 459 number to gobyte count went down significantlyaround 100 bytes from the original submission.
...Is that a good thing?

Try it online! Try it online!

Python 3.8 (pre-release), (削除) 538 (削除ここまで) (削除) 478 (削除ここまで) 459 bytes

-60 bytes by compressing some strings of characters in the die string.
-18 bytes by emanresu A.
-1 more byte by reducing 2*(c>3) to c//4*2.

from random import*
R=randrange
S=str.replace
P=lambda s:f'{[16,40,84,325,341,365,16,130,273,325,341,455][n[s]%12]:09b}'.translate(' o'*50)
c=R(8)
n=[3,*[0,1,5,4,0][c%4:][:2],2+c%2*6][::1-c//4*2]
for _ in[0]*R(3):n[1:]=[n[3]+6,n[1]+6,n[2]]
print(((S(S(S(""" .B.
 /A/|
 /A/}{|
 /A/}{ |
:B:}{ }{|
|A| }{ |
C }{:
|A| }{/
C/
|A|/
'B'""",'A',' %s %s %s '),'B','-'*11),'C','|'+' '*11+'|}{')%(*P(3)+P(1),))[::-1].format(*(a:=P(2))[6:]+a[3:6]+a[:3]))[::-1])

I've been banging my head against this problem for about 2 hours now (new record!). Expect the (削除) 538 (削除ここまで)(削除) 478 (削除ここまで) 459 number to go down significantly.

Try it online!

Python 3.8 (pre-release), (削除) 538 (削除ここまで) (削除) 478 (削除ここまで) (削除) 459 (削除ここまで) 441 bytes

-60 bytes by compressing some strings of characters in the die string.
-18 bytes by emanresu A.
-1 more byte by reducing 2*(c>3) to c//4*2.
-18 bytes by using not-quite-bytestrings-but-close-enough.

from random import*
R=randrange
S=str.replace
P=lambda s:f'{ord("(TŅŕŭ‚đŅŕLJ"[n[s]%12]):09b}'.translate(' o'*50)
c=R(8)
n=[3,*[0,1,5,4,0][c%4:][:2],2+c%2*6][::1-c//4*2]
for _ in[0]*R(3):n[1:]=[n[3]+6,n[1]+6,n[2]]
print(((S(S(S(""" .B.
 /A/|
 /A/}{|
 /A/}{ |
:B:}{ }{|
|A| }{ |
C }{:
|A| }{/
C/
|A|/
'B'""",'A',' %s %s %s '),'B','-'*11),'C','|'+' '*11+'|}{')%(*P(3)+P(1),))[::-1].format(*(a:=P(2))[6:]+a[3:6]+a[:3]))[::-1])

I've been banging my head against this problem for about 2 hours now (new record!). Thankfully, the byte count went down around 100 bytes from the original submission.
...Is that a good thing?

Try it online!

-19 bytes with some magic.
Source Link
squareroot12621
  • 1.2k
  • 1
  • 3
  • 18
Loading
-60 bytes by compressing some strings of characters in the die string.
Source Link
squareroot12621
  • 1.2k
  • 1
  • 3
  • 18
Loading
Source Link
squareroot12621
  • 1.2k
  • 1
  • 3
  • 18
Loading

AltStyle によって変換されたページ (->オリジナル) /