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

deleted 2 characters in body
Source Link
l4m2
  • 32.4k
  • 2
  • 26
  • 115

JavaScript (V8),(削除) 117 116 (削除ここまで)116114 bytes

f=(k=n=5*~R(4))=>++n?n%5?((R(~k%5)?k++&&''--''+f(k+1):'SWCR'[R(4)]+'ugbrycpw'[R(8)])+f]+f(k)):':'+f(n):''
R=n=>Math.random()*n|0

Try it online! Try it online!

If already \$k\$ empty in this layer, then there's \$\frac 1{4-k}\$ probably be not empty, aka 1 when already 3 empty

JavaScript (V8),(削除) 117 (削除ここまで)116 bytes

f=(k=n=5*~R(4))=>++n?n%5?((R(~k%5)?k++&&'--':'SWCR'[R(4)]+'ugbrycpw'[R(8)])+f(k)):':'+f(n):''
R=n=>Math.random()*n|0

Try it online!

If already \$k\$ empty in this layer, then there's \$\frac 1{4-k}\$ probably be not empty, aka 1 when already 3 empty

JavaScript (V8),(削除) 117 116 (削除ここまで)114 bytes

f=(k=n=5*~R(4))=>++n?n%5?R(~k%5)?'--'+f(k+1):'SWCR'[R(4)]+'ugbrycpw'[R(8)]+f(k):':'+f(n):''
R=n=>Math.random()*n|0

Try it online!

If already \$k\$ empty in this layer, then there's \$\frac 1{4-k}\$ probably be not empty, aka 1 when already 3 empty

added 10 characters in body
Source Link
l4m2
  • 32.4k
  • 2
  • 26
  • 115

JavaScript (V8), 117(削除) 117 (削除ここまで)116 bytes

f=(k=(n=5*~Rk=n=5*~R(4),4))=>++n?n%5?((R(k~k%5)?k--&&'k++&&'--':'SWCR'[R(4)]+'ugbrycpw'[R(8)])+f(k)):':'+f(4n):''
R=n=>Math.random()*n|0

Try it online! Try it online!

If already \$k\$ empty in this layer, then there's \$\frac 1{4-k}\$ probably be not empty, aka 1 when already 3 empty

JavaScript (V8), 117 bytes

f=(k=(n=5*~R(4),4))=>++n?n%5?((R(k)?k--&&'--':'SWCR'[R(4)]+'ugbrycpw'[R(8)])+f(k)):':'+f(4):''
R=n=>Math.random()*n|0

Try it online!

If already \$k\$ empty in this layer, then there's \$\frac 1{4-k}\$ probably be not empty, aka 1 when already 3 empty

JavaScript (V8),(削除) 117 (削除ここまで)116 bytes

f=(k=n=5*~R(4))=>++n?n%5?((R(~k%5)?k++&&'--':'SWCR'[R(4)]+'ugbrycpw'[R(8)])+f(k)):':'+f(n):''
R=n=>Math.random()*n|0

Try it online!

If already \$k\$ empty in this layer, then there's \$\frac 1{4-k}\$ probably be not empty, aka 1 when already 3 empty

Source Link
l4m2
  • 32.4k
  • 2
  • 26
  • 115

JavaScript (V8), 117 bytes

f=(k=(n=5*~R(4),4))=>++n?n%5?((R(k)?k--&&'--':'SWCR'[R(4)]+'ugbrycpw'[R(8)])+f(k)):':'+f(4):''
R=n=>Math.random()*n|0

Try it online!

If already \$k\$ empty in this layer, then there's \$\frac 1{4-k}\$ probably be not empty, aka 1 when already 3 empty

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