New answers tagged geometry
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
Related Tags
geometry × 321code-golf × 293
math × 100
graphical-output × 40
grid × 35
ascii-art × 32
combinatorics × 21
decision-problem × 16
code-challenge × 15
sequence × 14
kolmogorov-complexity × 14
string × 13
number × 11
arithmetic × 10
trigonometry × 10
array-manipulation × 8
integer × 8
image-processing × 7
3d × 7
polyomino × 7
random × 6
abstract-algebra × 6
tiling × 6
popularity-contest × 5
path-finding × 5