Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Posts by RubenVerg‭

10 posts
66%
+2 −0
Challenges Make $2 + 2 = 5$

Dyalog APL, 9 bytes +/⊢,2 2≡⊢ Takes the input as a pair +/ sum reduce ⊢ the input , concatenated with 2 2≡⊢ whether the input is equal to the list 2 2 (1 if true, 0 if false)

posted 10mo ago by RubenVerg‭

Answer
66%
+2 −0
Challenges Expected value of highest dice rolled

Dyalog APL, 14 bytes {6-+/⍵*⍨6÷⍨⍳5} Not bruteforce! An exact implementation of the formula \[ E_n = 6 - \sum_{i=1}^5 \left(\frac i 6\right)^n \] 6- 6 minus +/ the sum of 6÷⍨⍳5 the list 1/...

posted 10mo ago by RubenVerg‭  ·  edited 10mo ago by RubenVerg‭

Answer
60%
+1 −0
Challenges Expected value of highest dice rolled

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 ...

posted 10mo ago by RubenVerg‭  ·  edited 10mo ago by RubenVerg‭

Answer
60%
+1 −0
Challenges Can you give me half?

[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...

posted 10mo ago by RubenVerg‭  ·  edited 9mo ago by RubenVerg‭

Answer
60%
+1 −0
Challenges Roll n fair dice

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 ...

posted 10mo ago by RubenVerg‭

Answer
60%
+1 −0
Challenges Probability of rolling all 6 dice faces

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 ...

posted 10mo ago by RubenVerg‭  ·  edited 10mo ago by RubenVerg‭

Answer
60%
+1 −0
Challenges Probability of rolling all 6 dice faces

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{...

posted 10mo ago by RubenVerg‭  ·  edited 10mo ago by RubenVerg‭

Answer
60%
+1 −0
Challenges Probability of rolling all 6 dice faces

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 ...

posted 10mo ago by RubenVerg‭

Answer
60%
+1 −0
Challenges Label a hinged tetromino

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...

posted 10mo ago by RubenVerg‭  ·  edited 10mo ago by RubenVerg‭

Answer
50%
+0 −0
Challenges Digit Sum Integer Sequence (working title)

Dyalog APL, 23 bytes {⍵+(⌈/+⌊/)10⊥⍣¯1⊢⍵}⍣⎕⊢1­⁡​‎‎⁡⁠⁢⁢⁢‏⁠‎⁡⁠⁢⁢⁣‏‏​⁡⁠⁡‌⁢​‎⁠⁠‎⁡⁠⁢⁡⁤‏⁠‎⁡⁠⁢⁢⁡‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁢‏⁠‎⁡⁠⁣‏‏​⁡⁠⁡‌⁤​‎⁠‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏⁠‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏⁠‎⁡...

posted 7mo ago by RubenVerg‭  ·  edited 7mo ago by RubenVerg‭

Answer