We’re rewarding the question askers & reputations are being recalculated! Read more.

New answers tagged

1

C# (Visual C# Interactive Compiler), 177 bytes (d,o,f,v)=>string.Join(o=="*"?"":o,d<61?f.Select(l=>v.Aggregate("",(a,b)=>a+l+$"({b})")):v.Select((x,y)=>string.Concat(v.Select((i,o)=>o>=f.Count?i:f[(y+o)%f.Count]+$"({i})")))) Try it online!


1

Python 2, 179 190 194 bytes lambda d,o,F,V,S='%s(%s)':(o*(o>'*')).join([(''.join(S%(u,v)for v in V)for u in F if V),(''.join(map(lambda u,v:v and u and S%(u,v)or v or'',F,(V+V)[i:i+len(V)]))for i in range(len(V)))][d>'<']) Try it online! 11 bytes lost to fixing a bug. A function that takes a direction, an operator, a list of functions, and a ...


2

05AB1E, 62 bytes UÇ`θiVεY€…(ÿ)sì}ëDg©DIgα+>∍Œ®ùεζεðK'(ýDg≠i')«]®Ä≠iJ}¸˜Xý³g®*Ā× Four loose inputs in the order operator, direction, [variables], [functions]. Try it online. Explanation: TODO: Will add a test suite and explanation later on (after I hopefully golfed it some more as well..). I've verified all test cases by hand, though (hence the amount ...


4

JavaScript (ES6),  174  171 bytes (d,o,f,v,g=(f,V=v)=>f?V.map(v=>f+`(${v})`):V)=>f+f&&v+v?(d<'»'?f[1]?f.map(f=>g(f).join``):g(f[0]):v.map((_,i)=>v.map((_,j)=>g(f[j],[v[i++%v.length]])).join``)).join(o):'' Try it online! Commented ( d, // d = direction o, /...


0

Jelly, 21 bytes 20 if a list of digits is acceptable -- remove trailing Ḍ ...or if we may print with any leading zeros -- remove trailing Ḍ and replace the D with a Ṿ ZOḅ3/ḅ⁹%129ị“ȯṂṾ;’D¤Ḍ A monadic Link accepting a list of the three lines which yields an integer. Try it online! How? Magic... ZOḅ3/ḅ⁹%129ị“ȯṂṾ;’D¤Ḍ - Link: list of lists of characters Z ...


2

Python 3, 105 bytes f=lambda p,q,r:p and'5498136207'[int(''.join(map(str,p[:2]+q[:3]+r[:2])))%49%11]+f(p[3:],q[3:],r[3:])or'' Try it online! Takes input as three bytestrings. It considers the following sections in a digit, which gives a unique combination: _ 12 |_ => 345 _| 67 In this order, the base-10 ascii values for each character are ...


2

05AB1E, 25 bytes €S3δôøðQε˜JC15%•#/ι®ˆ¼•sè Input as a list of lines, output as a list of digits. If we could take the input as a 2D list of characters, the first 2 bytes can be removed. Try it online. Explanation: €S # Convert each line in the (implicit) input-list of strings to # an inner list of ...


1

Jelly, 26 bytes s€3=⁶ZF€Ḅ%15“pŻḣṾ:’b⁴¤iⱮ’Ḍ Try it online! A monadic link taking a list of three Jelly strings and returning an integer. Converts each input into a binary list where 1 is space and 0 anything else, converts back from binary, takes mod 15 (lowest divisor that yields unique output for each digit) and then looks these up in a list of 10 values ...


4

J, 55 bytes (0 3,:3 3)(6 7 8 11 4 2 13 14 5 9 i.15|[:#.@,' '&=);.3] Try it online! J has a primitive ;.3 called Subarrays that let's you process a multi-dimensional "sliding window". Here we have a 3x3 window moving 3 steps to the right each time, which grabs exactly 1 digit. We convert each 3x3 matrix to a boolean mask ' '&=, flatten it ,, and ...


1

PHP, 104 102 bytes -2 bytes thanks to Arnauld for(;!$i||$d&&print'6930274581'[crc32($d)%63%10];$i++)for($d=0;$a=$argv[++$$i];$d.=substr($a,$i*3,3)); Try it online! Takes input as 3 separate strings. How? I create a single line string for each digit with a leading "0" (10 in total for each digit), this is basically 3 lines of 3 characters for ...


1

Charcoal, 57 bytes E³SF÷L賫J⊕׳ι¹⊞υ÷⌕”{“→✂⌕Q¤αA?=¹⧴Zb⁻e⁵ηπ⪫Q¡”⁺KK⪫KMω⁹»⎚⪫υω Try it online! Link is to verbose version of code. Explanation: E³S Copy the three lines of input to the canvas. F÷L賫 Loop over the digits... J⊕×³ι¹ ... jump to the middle of the digit... ⊞υ÷⌕”{“→✂⌕Q¤αA?=¹⧴Zb⁻e⁵ηπ⪫Q¡”⁺KK⪫KMω⁹ ... and concatenate the nine characters of ...


8

JavaScript (ES6),  105  104 bytes Takes input as an array of 3 strings. Returns an array of digit characters. a=>a.map(s=>s.match(/.../g).map(([a,b,c],n)=>'3789465021'[(o[n]=~~o[n]+[++a|7*++b^44*++c])%13]),o=[])[2] Try it online! How? Finding a concise way to process the input A common trick to turn an input string into an identifier ...


Top 50 recent answers are included