Skip to content

Instantly share code, notes, and snippets.

package you;
import clowns.Clown;
import clowns.Volkswagen;
public class You {
private static class BandOfClowns extends Clown {
final int id;
@jnegre
jnegre / Sierpinski.groovy
Created December 19, 2011 19:22
Constructs a Sierpinski triangle in a Unicode-aware console with fixed-width font
// Constructs a Sierpinski triangle in a Unicode-aware console with fixed-width font
// Based on an idea from Olivier Croisier http://twitter.com/OlivierCroisier/statuses/148809114531799040
int numOfLines = 16 //2^n
int[][] c = new int[numOfLines][numOfLines]
int delta = numOfLines
c[0][0] = 1
println "${' '*delta--}\u25B2"
(1..<numOfLines).each { i->
package org.jnegre;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;