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

added 110 characters in body
Source Link
hyperneutrino
  • 42.8k
  • 5
  • 72
  • 227

Proton, 155142 bytes

n=>x=>"\\tabular*%dc|c#n=>x=>"\\tabular*#{'&'.joinn}c|c#{j(map(chr,range(97,..97+n)))}&F\\\\\hline#{'\\\\\\\\'&F\\\\\hline"+'\\\\'.join('&'.joinj(bin(i)[2to].zfill(n)+x[i])for i:0..len(x))}\\endtabular"%n+"\\endtabular"j="&".join

Try it online! Try it online!

This should be able to beOutput is in golfed LaTeX form; thanks to shorter than xnor's Python answer because Proton should in theory never losexnor for that trick!

(削除) This should be able to be golfed to shorter than xnor's Python answer because Proton should in theory never lose to Python lol (in practice I'm bad xD). I may steal some tricks from xnor ;P (削除ここまで)

Managed to Python lol (in practice I'm bad xD).now be shorter by making some things into variables, which I may stealjust noticed xnor also did :P

And there we go, -6 bytes by using some Proton golfing tricks from xnor ;P.

Proton, 155 bytes

n=>x=>"\\tabular*%dc|c#{'&'.join(map(chr,range(97,97+n)))}&F\\\\\hline#{'\\\\\\\\'.join('&'.join(bin(i)[2to].zfill(n)+x[i])for i:0..len(x))}\\endtabular"%n

Try it online!

This should be able to be golfed to shorter than xnor's Python answer because Proton should in theory never lose to Python lol (in practice I'm bad xD). I may steal some tricks from xnor ;P

Proton, 142 bytes

n=>x=>"\\tabular*#{n}c|c#{j(map(chr,97..97+n))}&F\\\\\hline"+'\\\\'.join(j(bin(i)[2to].zfill(n)+x[i])for i:0..len(x))+"\\endtabular"j="&".join

Try it online!

Output is in golfed LaTeX form; thanks to xnor for that trick!

(削除) This should be able to be golfed to shorter than xnor's Python answer because Proton should in theory never lose to Python lol (in practice I'm bad xD). I may steal some tricks from xnor ;P (削除ここまで)

Managed to now be shorter by making some things into variables, which I just noticed xnor also did :P

And there we go, -6 bytes by using some Proton golfing tricks.

Source Link
hyperneutrino
  • 42.8k
  • 5
  • 72
  • 227

Proton, 155 bytes

n=>x=>"\\tabular*%dc|c#{'&'.join(map(chr,range(97,97+n)))}&F\\\\\hline#{'\\\\\\\\'.join('&'.join(bin(i)[2to].zfill(n)+x[i])for i:0..len(x))}\\endtabular"%n

Try it online!

This should be able to be golfed to shorter than xnor's Python answer because Proton should in theory never lose to Python lol (in practice I'm bad xD). I may steal some tricks from xnor ;P

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