Search
Jelly, 8 bytes İ€S<¬ʋ1# Try it online! How it works İ€S<¬ʋ1# - Main link. Takes n on the left ʋ - Group the previous 4 links into a dyad f(k, n): € - Over each integer...
Mathematica, 4 bytes OddQ Not at all my code - this is the original post by Martin Ender. Prints True for odd inputs and False for even inputs.
BQN, 11 9 bytesSBCS Run online! 1⌽⍟⊢⍋3|↕9 The result is a length 9 list of lists using the numbers 0 to 8. The solution is based on the 3x3 transpose list 036147258, obtained with Grade Up. T...
Adding display:flex; align-items:center to .toc--full items centers the names and code samples vertically, which I think looks a little better.
Multiply complex numbers. 2 space-seperated ones will be input, as follows: (update: you can replace i with j or some other symbol if needed) a+bi -a+bi a-bi -a-bi where a and b are integers ...
///, 13 bytes Hello, World! Someone had to. 18 bytes using replacement /x/H/xello, World! 23 bytes using two-layer replacement /a/Hello, World!//b/a/b a is replaced with Hello, World! ...
I'm not a golfer, I know, but I do have wanted to make a programming language back then. The name is BMPL (Builder's Multi-Purpose Language) and is currently a library I made in C (clang). It's not...
Jelly, 7 bytes œPżịẊ¥F Try it online! Takes the 1-indexed indices on the left and the list on the right How it works œPżịẊ¥F - Main link. Takes I on the left and L on the right œP - Pa...
JavaScript (Node.js), 75 68 bytes -7 bytes thanks to Hakerh400 (a,b)=>b.map(i=>[a[i],a[j]]=[a[j=b[Math.random()*b.length|0]],a[i]]) Try it online! Basic random swap algorithm. Unfortuna...
C (gcc), 301 bytes Function taking in an array of null-terminated strings and the array's length. #include <string.h> #include <stdlib.h> char*s="edellowreenrowncarletlackchreachuby...
Jelly, 3 bytes Rç/ Try it online! Takes f as the helper link. Very basic, R casts to range, then ç/ reduces by the helper link
HTML + CSS, 29 + 677 (706) bytes HTML: <div id="S"><div></div></div> CSS: #S{box-sizing:border-box;position:relative;display:block;height:192px;width:163px;}#S div{pos...
C, 534 bytes Strictly conforming program. #include <stdio.h> #include <stdlib.h> #include <string.h> char i=1,**c,**d,*t[30]={"red","yellow","green","brown","scarlet","blac...
I have a question about everyone's favourite Code Golf editor https://tio.run. After picking a language, is there a sensible way to enter command line arguments to it, other than adding them manual...
APL (Dyalog Unicode), 4 bytes ⎕/⍳⎕ Try it online! ⎕ input / reduction over ⍳ the integers until ⎕ input.
brainfuck, 40 bytes Outputs ÿ if all elements are equal, and \x00 byte otherwise. ->,>,[[-<->>+<]<[-<[-]>]>>[-<<+>>]<,]<<. Try it online! ...
JavaScript, 102 bytes s=>[...x=s.split``].concat(x.reverse()).reduce((l,c,i,a)=>l+` `+(a[i+1]?c+' '.repeat(i-1)+c:a.join``)) The first part creates the 'mirrored' string in an array. red...
JavaScript, 20 bytes Outputs false for truthy and true for falsey. a=>a.some(x=>x-a[0]) Try it online! Outputs true and false as normal. a=>new Set(a).size<2 Try it online!
Japt, 4 bytes Takes the operator as a string but would also work without modification using a function by assigning it to variable V. That can be done in the header by leaving a blank line and the...
JavaScript, 37 32 bytes Outputs a comma delimited string. f=n=>n-1?n+[,f(n**(.5+n%2)|0)]:n Try it online!
JavaScript, 25 bytes The function is called with f(g)(n), where g is a function. g=>h=n=>n-1?g(h(n-1),n):1 Try it online!
Python 2, 33 bytes lambda a,b:reduce(a,range(1,1+b)) Try it online! Or, without using the reduce built-in: Python 2, 37 bytes f=lambda a,b:b-1and a(f(a,b-1),b)or 1 Try it online!
Husk, 5 bytes ±£Θİ□ Try it online! similar to haskell, checks if the number is in the infinite list of squares.