Skip to content

Instantly share code, notes, and snippets.

@evinjaff
evinjaff / Triangle.java
Last active April 20, 2024 22:39
Recursive Sierpinski Triangle in Java
import java.awt.Color;
import sedgewick.StdDraw;
public class Triangles {
public static void triangle(double x, double y, double s, int n){
// X and y are base coordinates, s is size, n is number of recursions