String[] lines; PFont font; int counter; void setup() { size(450, 450); font = createFont("Trebuchet MS", 16); lines = new WordCount().collectLines(createReader("Biggie.txt")); } void draw() { int momscount = 0; int bitchcount = 0; int hoecount = 0; int chickenheadcount = 0; int honeycount = 0; int gatcount = 0; int teccount = 0; int glockcount = 0; int ninecount = 0; int lexuscount = 0; int benzcount = 0; int jacuzzicount = 0; int projectscount = 0; int clubcount = 0; background(0); fill(255); textFont(font); noStroke(); textAlign(CENTER); textSize(20); text("BIGGIE SMALLS: A Life In Numbers", width/2, 40); for (int i = 0; i < lines.length; i++) { String[] tmp = split(lines[i], ":"); String word = tmp[0]; int count = int(tmp[1]); if (word.equals("mom")) { momscount+=count; } if (word.equals("moms")) { momscount+=count; } if (word.equals("bitches")) { bitchcount+=count; } if (word.equals("bitch")) { bitchcount+=count; } if (word.equals("hoes")) { hoecount+=count; } if (word.equals("hoe")) { hoecount+=count; } if (word.equals("honey")) { honeycount+=count; } if (word.equals("honeys")) { honeycount+=count; } if (word.equals("chickenhead")) { chickenheadcount+=count; } if (word.equals("chickenheads")) { chickenheadcount+=count; } if (word.equals("gat")) { gatcount+=count; } if (word.equals("gats")) { gatcount+=count; } if (word.equals("tec")) { teccount+=count; } if (word.equals("tecs")) { teccount+=count; } if (word.equals("glock")) { glockcount+=count; } if (word.equals("glocks")) { glockcount+=count; } if (word.equals("nine")) { ninecount+=count; } if (word.equals("nines")) { ninecount+=count; } if (word.equals("lexus")) { lexuscount+=count; } if (word.equals("lex")) { lexuscount+=count; } if (word.equals("benz")) { benzcount+=count; } if (word.equals("jacuzzi")) { jacuzzicount+=count; } if (word.equals("projects")) { projectscount+=count; } if (word.equals("club")) { clubcount+=count; } // text(word, random(width), random(height)); } switch(counter%3) { case 0: textSize(16); text("Biggie's Women", width/2, 310); fill(71, 109, 36); float galtotal = (bitchcount+hoecount+honeycount+chickenheadcount+momscount); arc(width/2, height/2-50, 200, 200, 0, TWO_PI*(bitchcount/galtotal)); fill(242, 159, 5); arc(width/2, height/2-50, 200, 200, TWO_PI*(bitchcount/galtotal), TWO_PI*(hoecount/galtotal)+TWO_PI*(bitchcount/galtotal)); fill(191,91,4); arc(width/2, height/2-50, 200, 200, TWO_PI*(hoecount/galtotal)+TWO_PI*(bitchcount/galtotal), TWO_PI*(honeycount/galtotal)+TWO_PI*(hoecount/galtotal)+TWO_PI*(bitchcount/galtotal)); fill(89,25,2); arc(width/2, height/2-50, 200, 200, TWO_PI*(honeycount/galtotal)+TWO_PI*(hoecount/galtotal)+TWO_PI*(bitchcount/galtotal), TWO_PI*(chickenheadcount/galtotal)+TWO_PI*(honeycount/galtotal)+TWO_PI*(hoecount/galtotal)+TWO_PI*(bitchcount/galtotal)); fill(166,33,3); arc(width/2, height/2-50, 200, 200, TWO_PI*(chickenheadcount/galtotal)+TWO_PI*(honeycount/galtotal)+TWO_PI*(hoecount/galtotal)+TWO_PI*(bitchcount/galtotal), TWO_PI*(chickenheadcount/galtotal)+TWO_PI*(honeycount/galtotal)+TWO_PI*(hoecount/galtotal)+TWO_PI*(bitchcount/galtotal)+TWO_PI*(momscount/galtotal)); stroke(255); fill(71, 109, 36); rect(30, 340, 20,20); fill(255); textSize(12); textAlign(LEFT); text("Bitches" + " (" + str(100*bitchcount/galtotal) + "%)", 55, 355); fill(242, 159, 5); rect(30, 370, 20,20); fill(255); text("Hos" + " (" + str(100*hoecount/galtotal) + "%)", 55, 385); fill(191,91,4); rect(30, 400, 20,20); fill(255); text("Honeys" + " (" + str(100*honeycount/galtotal) + "%)", 55, 415); fill(89,25,2); rect(width/2, 340, 20,20); fill(255); text("Chickenheads" + " (" + str(100*chickenheadcount/galtotal) + "%)", 25+width/2, 355); fill(166,33,3); rect(width/2, 370, 20,20); fill(255); text("Mom" + " (" + str(100*momscount/galtotal) + "%)", 25+width/2, 385); break; case 1: textSize(16); text("Biggie's Armory", width/2, 310); fill(56, 107, 109); float guntotal = (gatcount+teccount+glockcount+ninecount); arc(width/2, height/2-50, 200, 200, 0, TWO_PI*(gatcount/guntotal)); fill(122,36,24); arc(width/2, height/2-50, 200, 200, TWO_PI*(gatcount/guntotal), TWO_PI*(teccount/guntotal)+TWO_PI*(gatcount/guntotal)); fill(97,132,62); arc(width/2, height/2-50, 200, 200, TWO_PI*(teccount/guntotal)+TWO_PI*(gatcount/guntotal), TWO_PI*(glockcount/guntotal)+TWO_PI*(teccount/guntotal)+TWO_PI*(gatcount/guntotal)); fill(122,98,57); arc(width/2, height/2-50, 200, 200, TWO_PI*(glockcount/guntotal)+TWO_PI*(teccount/guntotal)+TWO_PI*(gatcount/guntotal), TWO_PI*(ninecount/guntotal)+TWO_PI*(glockcount/guntotal)+TWO_PI*(teccount/guntotal)+TWO_PI*(gatcount/guntotal)); stroke(255); fill(56, 107, 109); rect(30, 340, 20,20); fill(255); textSize(12); textAlign(LEFT); text("Gats" + " (" + str(100*gatcount/guntotal) + "%)", 55, 355); fill(122,36,24); rect(30, 370, 20,20); fill(255); text("Tec-5s" + " (" + str(100*teccount/guntotal) + "%)", 55, 385); fill(97,132,62); rect(width/2, 340, 20,20); fill(255); text("Glocks" + " (" + str(100*glockcount/guntotal) + "%)", 25+width/2, 355); fill(122,98,57); rect(width/2, 370, 20,20); fill(255); text("Nines" + " (" + str(100*ninecount/guntotal) + "%)", 25+width/2, 385); break; case 2: textSize(16); text("Biggie's chillin in the...", width/2, 100); fill(249,58,82); rect(100, 120, 500*benzcount/(benzcount+lexuscount+jacuzzicount+projectscount+clubcount), 50); fill(255); textSize(12); textAlign(LEFT); text("Benz", 30, 150); fill(43,76,109); rect(100, 180, 500*lexuscount/(benzcount+lexuscount+jacuzzicount+projectscount+clubcount), 50); fill(255); textSize(12); textAlign(LEFT); text("Lexus", 30, 210); fill(249,160,70); rect(100, 240, 500*projectscount/(benzcount+lexuscount+jacuzzicount+projectscount+clubcount), 50); fill(255); textSize(12); textAlign(LEFT); text("Projects", 30, 270); fill(185,166,103); rect(100, 300, 500*clubcount/(benzcount+lexuscount+jacuzzicount+projectscount+clubcount), 50); fill(255); textSize(12); textAlign(LEFT); text("Club", 30, 330); fill(56,122,85); rect(100, 360, 500*jacuzzicount/(benzcount+lexuscount+jacuzzicount+projectscount+clubcount), 50); fill(255); textSize(12); textAlign(LEFT); text("Jacuzzi", 30, 390); break; } noLoop(); } void mousePressed() { counter++; redraw(); }