Skip to content

Instantly share code, notes, and snippets.

@pfirpfel
pfirpfel / gist:6852663
Last active December 24, 2015 19:39
Processing Chessboard 12x12 with funky colors
void setup(){
size(480,480);
frameRate(64);
for(int x = 0; x < 8; x++){
for(int y = 0; y < 8; y++){
if((x+y)%2 == 0){
fill(255);
} else {
fill(0);
}
public class MaxThreads {
private static int count = 0;
public static void main (String[] args){
while(true){
Thread t = new Thread(new T(), ++count + "");
t.start();
System.out.println(count + "");
}
public class QuickSortMSP {
private static int noOfSwaps = 0;
public static void main(String[] args) {
int arr[] = {5,5,5,5,5};
sort(arr);
System.out.print("Swaps: "+noOfSwaps);
}
public static void sort(int[] arr){
@pfirpfel
pfirpfel / ArrayIterator.java
Created October 31, 2012 14:53
Generic Array Iterator
package pfirpfel;
import java.util.Iterator;
import java.util.NoSuchElementException;
public class ArrayIterator<E> implements Iterator<E> {
private E[] array;
private int index = 0;
private boolean lastRemoved = false;
@pfirpfel
pfirpfel / splitcube.tsv
Created October 22, 2012 15:47
pfirpfel's splitcard-cube as tab-seperated list
Tundra Mirrorweave
Underground Sea Undermine
Badlands Blightning
Taiga Artifact Mutation
Savannah Aura Mutation
Scrubland Zealous Persecution
Volcanic Island Prophetic Bolt
Bayou Maelstrom Pulse
Tropical Island Aether Mutation
Plateau Master Warcraft