Search
JavaScript (Browser), 670 bytes for(_="=1,w=):=0,w(=f(||(.join`w?q-w?q=-w(a,b=>A(L*5,a),g.innerText=N=L=D=T,I=,c,d)a-d?I,b(d,cd+1c,A=)I(a,(x,y)[...y,b(x)],[](U=_(Kf=({value:a})a==[a|]+[]&&a...
Jelly, 1 byte ḅ Try it online! Essentially just Razetime's APL answer, except in that ḅ vectorizes rather than carrying out mixed base conversion--irrelevant if, as is the case here, the provi...
Python 3, 101, 98, 94 bytes First answer! lambda s:f"{(('FCGDAEB'.index(s[0])-~-ord(s[5])*('-'in s)-3*('i'in s)-6)%12)+1}"+'BA'['i'in s] Try it online! Readable version: def f(s): n="FCG...
V (vim), 11 bytes ÀñY>HGpé/Á\ Try it online! Hexdump: 00000000: c380 fe58 c3b1 593e 4847 70c3 a92f c381 ...X..Y>HGp../.. 00000010: 5cc3 bfc3 \...
LOLCODE, 37 bytes HAI 1 VISIBLE "Hello, World!" KTHXBYE Try it online!
SE Sandbox Link, Codidact Sandbox Link Inspired by this video. Given a positive integer, draw its Cistercian representation as ascii art. The Challenge Cistercian numerals are a decimal-based...
Shakespeare Programming Language, 11232 bytes My last attempt was nearing the 20000 byte zone, because it didn't use the stack at all. a.Ajax,.Puck,.Ford,.Act I:.Scene I:.[Enter Ajax and Puck]Aja...
Given a musical key, output its number and letter on the Camelot Wheel (shown below). Input A musical key as a string, as shown on the wheel. The words "Sharp" and "Flat" may be replaced with s...
C (gcc), 32 bytes f(a,b){return a>0?f(b,a-b)+1:0;} Try it online!
Given a single character, which is a valid Roman numeral, output its value. Values There are 7 valid single character Roman numerals, with the following values: Character Value I...
Haskell, 56 bytes f a=a:f(a+g(read.pure<$>show a)) g a=minimum a+maximum a Try it online!
Ruby, 34 29 bytes ->s,n{s.chars.map{_1*n}*""} Try it online!
Challenge Given the roots of a polynomial (that is, the $x$ values where the polynomial evaluates to zero), as an array of real numbers, return the polynomial's coefficients. That is, given real ...
Challenge Make a program that takes input of a string and abbreviate it. All letters of an abbreviation are capitalized, so keep that in mind. Whitespace, numbers and non-English characters ar...
Python 3, 142 bytes def f(s): m=1;r="" for c in s.upper(): if'@'<c<'['or'-'==c:r+=c*m;m=0 if c in":; ":r+=c*(c!=' ');m=1 if c in".?!":r+=' ';m=1 return r Try it online!
Haskell, 139 138 bytes import Data.Char f(a:b)|d a=toUpper a:f(dropWhile(\a->e a"-'"||d a)b)|e a":;"=a:c|e a".?!"=' ':c|0<1=c where c=f b;d=isLetter;e=elem f a=a Try it online!
Haskell, 43 39 bytes f 1=0 f n=1+f([div n 2,n*3+1]!!mod n 2) Try it online!
Python 3, 48 42 39 bytes Saved 6 bytes thanks to Hakerh400 in the comments Saved another 3 bytes thanks to user in the comments f=lambda n:n-1and-~f([n//2,3*n+1][n%2]) Try it online!
Sclipting, (UTF-16) 44 34 32 bytes 貶要❶갠剩❷隔❸增갰乘嗎終并長貶 Because comparing with 1 is expensive (requires copying and decrementing), we instead use a modified version of the Collatz sequence - namely...