Search
Vyxal, 12 bitsv2, 1.5 or 2 bytes øṘ Try it Online! or Try the entire test suite Bitstring: 000101111100 Very simply a built-in
For challenges that require a input, what is the maximum a solution has to support, if not further specified by the challenge author? Lets say the input is a string, how long a string has to be ac...
At my job we have to sometimes lay out materials. Materials come in large long rolls and are cut into smaller pieces when being laid out. When we order the rolls we draw up a layout document which...
Dyalog APL, 21 bytes {≢⍸6=(≢∪)¨⍳⍵/6}÷(6∘*) Bruteforce solution :) ⍳⍵/6 n-dimensional array of all possibilities of rolling $n$ dice, each element is a vector of the dice values ≢ count the ...
Thunno 2, 14 bytes 6RẉDæḳ6R⁼;,ḷẸ\ Attempt This Online! Note: brute-force, so times out for $n\ge5$ on ATO, but I have verified it with $n=6$ on my computer. Explanation 6RẉDæḳ6R⁼;,ḷẸ\ # Imp...
Dyalog APL, 19 bytes (with index origin zero) {-/(!∘6×⍵*⍨6÷⍨⊢)⍳7} This isn't bruteforce! The number of cases where all six faces appear are the OEIS sequence A000920. \[ P_n = \frac{\mathsf{...
Dyalog APL, 2 bytes ?⍴ Dyadic 2-train, takes $n$ as its left argument and $m$ as its right argument The Roll function ? expects an array of maximum bounds and replaces each item with a random ...
[Extended] Dyalog APL, 4 bytes* *10 bytes, 4 unique '÷'÷⍥≢'÷÷' This computes the length of the string '÷' divided by the length of the string '÷÷' Alternate solution (extended only) (6 unique...
cQuents*, 10 bytes O920A$/6^$ That * there is because, while this should be a specification-correct program that does the correct computation, the only interpreter available does not implement ...
Dyalog APL, 89 bytes {1∊∘∊¨⍷¨∘⍵¨⍬{0∊⍴⍵:⍺⋄(⍺,⊂A)∇⍵~A←(⌽¨,⊢)(⊖¨,⊢)(⍉¨,⊢)⊣/⍵}(e⍤⍉e←{⍵/⍨×+⌿⍵})¨4 4∘⍴¨,⌿2⊥⍣¯1⍳2*16} Requires IO to be zero. Thanks Adám for -8 bytes! Ungolfed version: { remove...
x86-32 assembly, 14 bytes Straightforward solution with custom calling convention: inputs in eax and ebx, output in eax. cmp opcode could be smaller if limited to 8-bit integers? 00000000 <add...
Dyalog APL, 16 bytes {(+/÷≢)⌈/¨,⍳⍵/6} Explanation: ,⍳⍵/6 generate a list of all the possible sets of rolls ⌈/¨ find the maximum of each +/÷≢ find the average (sum up all values and divide ...
I'd like to post king-of-the-hill contests that read code directly from answers Essentials This is the only feature I would need in order to start posting contests. The answer content for each...
Ruby, 63 bytes ->n{(2..16).max_by{|x|n.digits(x).sum{45088003.digits(3)[_1]}}} Attempt This Online!
Vyxal, 9 bytes ×»∇ḂẆ»f꘍§ Try it Online! Uses spaces for empty and asterisks for queen. Add a › at the end to replace spaces with zeros. ×»∇ḂẆ»f꘍§ »∇ḂẆ»f # 13572064 as a list of digits × ...
Vyxal, 19 18 bytes 16Ḣλ»≤ṪḢ»3τ?nτİ∑;∴ Try it Online! The link goes to a program which has every test case. -1 thanks to Steffan Explained (old) 16Ḣλ?$τ»≤ṪḢ»3τ$İ∑;O 16Ḣ # Th...
J, 20 bytes '01'{~#:2^2842 A.i.8 Attempt This Online! Non-tacit program that outputs implicitly in a REPL. Shoutout to Raul (Miller)#5220 in the APL farm discord for thinking of this cool idea...
I've now posted on Codidact Meta How should a Codidact public API work? I'll still be taking into account any discussion here if you have Code Golf specific thoughts, but for general API discussio...
Try it online doesn't support the latest JavaScript features such as optional chaining or null coalescence, which are very useful character-saving operators. Is there another site like TIO, but whi...
Python 3, 325 322 bytes -3 bytes thanks to steffan153! from base64 import* n=int.from_bytes(b85decode('8C^#Z9Uor=^}*nk`yLA}A<z=aTm_V+z!I{Y1+v7z89f>WmC>M4TN(sPp`fvySOeqafPpzk0!*=hK2{h9D...
Python 3, 326 bytes print("fig gấc abiu açaí bael date lime lulo neem noni pear pili plum rimu sloe sorb yuzu ackee akebi apple araza cacao caqui carob etrog grape guava ilama jagua kokum kubal ...
Vyxal, 244 bytes `↔ė ¹¢ Ṁṙ ṫ₁ λǎ ȧ₴ ¶Ŀ ¯¡ ɾ⟨ ²ǒ aǍ₄ b₴⟩ l℅₆ n꘍ƒ pƛṖ pṁ‹ p⋏µ p⇧Ż r⋏⅛ s⇧⁋ s⋎Ė ≈•꘍₈ ak↳⁼ …⋎꘍⇩ ₴ꜝza Ǎṁ…℅ ǍŀṪṄ •øĊ¯ ∞¨Ċ¯ ∧¡ǎŀ Ǎ§Ċ¯ ⟇⁺Ċ¯ ₃Ẏ꘍⁼ ṙ†ð‛ ṙ†Ṗ₃ ...