Skip to main content
Commonmark migration
Source Link

#Java

Java

#Java

Java

added another sorting method.
Source Link
Justin
  • 21.3k
  • 9
  • 67
  • 114

And now the Sierpinski Triangle, tilted:

public int compare(Point t, Point t1) {
    int compareVal = (Integer.bitCount(t.x | t.y))
            - (Integer.bitCount(t1.x | t1.y));
    return compareVal < 0 ? -1 : compareVal == 0 ? 0 : 1;
}

enter image description here

And now the Sierpinski Triangle, tilted:

public int compare(Point t, Point t1) {
    int compareVal = (Integer.bitCount(t.x | t.y))
            - (Integer.bitCount(t1.x | t1.y));
    return compareVal < 0 ? -1 : compareVal == 0 ? 0 : 1;
}

enter image description here

added another sorting method.
Source Link
Justin
  • 21.3k
  • 9
  • 67
  • 114

Yet another variation (personal favorite; remindsreminds me of cellular automata):

enter image description here

Yet another another variation (new personal favorite):

public int compare(Point t, Point t1) {
    int compareVal = (Integer.bitCount(t.x ^ t.y))
            - (Integer.bitCount(t1.x ^ t1.y));
    return compareVal < 0 ? -1 : compareVal == 0 ? 0 : 1;
}

enter image description here

It looks so fractal-ly. XOR is so beautiful, especially closeup:

enter image description here

Another closeup:

enter image description here

Yet another variation (personal favorite; reminds me of cellular automata):

enter image description here

Yet another variation (reminds me of cellular automata):

enter image description here

Yet another another variation (new personal favorite):

public int compare(Point t, Point t1) {
    int compareVal = (Integer.bitCount(t.x ^ t.y))
            - (Integer.bitCount(t1.x ^ t1.y));
    return compareVal < 0 ? -1 : compareVal == 0 ? 0 : 1;
}

enter image description here

It looks so fractal-ly. XOR is so beautiful, especially closeup:

enter image description here

Another closeup:

enter image description here

Syntax coloring
Source Link
Justin
  • 21.3k
  • 9
  • 67
  • 114
Loading
Source Link
Justin
  • 21.3k
  • 9
  • 67
  • 114
Loading