Search
Embed ESCR, 28 characters [= [exp [rnd [sqrt n]] 2] n] The number to test is in N. There are 4 nested functions. From inner to outer: SQRT takes the square root of N. This produces a floating ...
J, 21 bytes ,&'+".1!:1(3)'1!:1(3) Try it online! STDIN is ugly in J because you have to use foreigns.
ESCR, 35 bytes show "show [+ [arg 1] " [arg 1] "]" The SHOW command writes to standard output. The parameters in quotes are just fixed strings. The ARG function returns a numbered argument. In...
J, 50 bytes {{({~[:y&(i.&1@:=)[:>+/&.>),{@(,&<)~p:i.p:^:_1 y}} Try it online! A nasty DD solution. {{({~[:y&(i.&1@:=)[:>+/&.>),{@(,&<)~p:i.p:...
Ruby, 69 bytes require'prime';->n{Prime.first(n).then{_1.product _1}.find{_1+_2==n}} Try it online!
Python 3.8, 112 bytes def f(x):y=[i for i in range(2,x)if not[j for j in range(2,i)if i%j<1]];return[(q,x-q)for q in y if x-q in y][0] Try it online!
Ruby, 62 bytes require'prime';f=->n,k=0{n.prime?&&k.prime?? [n,k]:f[n-1,k+1]} Attempt This Online!
MATL, 4 bytes tPX= Try it online! tPX= t - duplicate with implicit input P - fliplr in MATLAB, reverses top of stack X= - isequal
MATL, 19 bytes XH:YqtZ*!tsH=f1Z)Z) Try it online! I'm still a novice at MATL, so I am all ears to any improvements. XH:YqtZ*!tsH=f1Z)Z) XH - copy implicit input to H clipboa...
SOS, 155 Bytes !+!-!!+!-!!!!+!!-!!+!-!+!-!+!!-!+!!-!!!+!!-!+!!-!!!+!!-!+!!!!-!!+!-!+!!-!!!!+!-!!!!!!+!-!+!-!+!!!-!+!!-!+!!!!-!+!!!-!!+!-!!+!!-!+!!-!!!+!!-!!+!-!!+!-!!!!+! Explanation: Each ! o...
SOS, 76 bytes +>+>?<+>?<+>?<+>?<+>?<+>?<+>?<+>?<<)<<-(>{>!<{>!<{>!<{>!<{>!<{>!<{>!<{>!&l...
JavaScript (V8), 78 bytes f=s=>s.map(c=>(_==256||_<0?_=0:0)||c=='i'?_++:c=='d'?_--:c=='s'?_*=_:v+=_+' ') Try it online!
Lua 5.4.4, 51 bytes function f(n)return n<2 and n or f(n-1)*2+f(n-2)end Try it online!
C (gcc), 35 bytes f(n){return n<2?n:f(n-1)*2+f(n-2);} Try it online!
JavaScript, 104 102 99 bytes I/O as a character array. a=>a.filter(x=>a<g(x)&g(x)<a[~-a.length],a=a.map(g=x=>[...Buffer(x)[0].toString(2)].sort()).sort()) Try it online!
Given a radius R, output a text representation of a circle. Input A positive integer R (strictly greater than zero) You do not need to handle values of R greater than 32 Output A square ...
Since the examples I've given in the question are deliberately brief, they don't demonstrate the benefit of hiding a large block of text. I'm giving an example in this answer of one of my own chall...
Factor, 30 29 bytes [ readln "Hello, %s!"printf ] Try it online! Uses io and formatting.
JavaScript, 52 51 28 bytes s=>Buffer(s).map(x=>x|32)+`` Try it online! -1 byte thanks to trichoplax.
Python, 89 bytes lambda l,g=lambda c:ord(c).bit_count():[i for i in l if min(map(g,l))<g(i)<max(map(g,l))] Attempt This Online!