New answers tagged

0

Jelly, 14 bytes ×:4“CEDM”xsṢ€Y Try it online! Implements aditsu's algorithm How it works ×:4“CEDM”xsṢ€Y - Main link. Takes h on the left and w on the right × - Yield h×w :4 - Integer divide by 4; Yield R = (h×w):4 “CEDM” - Yield "CEDM" x - Repeat each character R times s - Split into rows ...


1

Rust, 44 bytes |n|{n.sort();n[0]*n[0]+n[1]*n[1]==n[2]*n[2]} Try it online! Takes in an &mut[u64] of at least three elements and proceeds to sort and test if the Pythagorean theorem holds. If sorting floats in rust were easier (it's hard because they can't implement the Ord trait, which is required by the sorting functions) I could use the hypot ...


2

Templates Considered Harmful, 140 bytes Fun<Ap<Fun<bor<Eq<Add<A<1>,A<2>>,A<3>>,bor<Eq<Add<A<2>,A<3>>,A<1>>,Eq<Add<A<3>,A<1>>,A<2>>>>>,Mul<A<1>,A<1>>,Mul<A<2>,A<2>>,Mul<A<3>,A<3>>>> Try ...


Top 50 recent answers are included