// information. reading a simple relation. alphabet city. // leopold bloom is in manhattan. // typewriter. // letters will read from Ulysses last chapter and try to remember their neighbours. // it seems molly bloom never used the "z" int piso, techo, pizq, pdere; // String alfabeto = "!ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz?1234567890"; // String alfabeto = "QWERTYUIOPASDFGHJKLZXCVBNM?qwertyuiopasdfghjklzxcvbnm!1234567890"; String alfabeto = "QqWwEeRrTtYyUuIiOoPpAaSsDdFfGgHhJjKkLlZzXxCcVvBbNnMm?!1234567890"; // String alfabeto = "qwertyuiopasdfghjklzxcvbnm"; String alfabetote = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int num = alfabeto.length(); int lector = 0; float gravedad = 0; float elasticidad = 0; float friccion = 0; boolean arrancar = false; PFont font; byte book[]; Pelota[] pelotas = new Pelota[num]; void setup() { size(400,400); background(255,20,30); framerate(30); ellipseMode(CENTER_RADIUS); noLoop(); font = loadFont("Monaco-12.vlw"); book = loadBytes("mollyBloom.txt"); // book.length = 120366 piso = height; techo = 0; pdere = width; pizq = 0; for ( int i=0; i= width/8) vely += gravedad; } void rebote(){ if ( y + vely + radio > piso ){ // el piso la orilla es igual a width y = piso - radio; velx *= friccion; vely *= -elasticidad; } if ( y + vely - radio < techo ){ // el techo en la orilla es igual a cero y = techo + radio; velx *= friccion; vely *= -elasticidad; } if ( x + velx + radio > width ){ x = width - radio; velx *= -elasticidad; vely *= friccion; } if ( x + velx - radio < 0 ){ x = radio; velx *= -elasticidad; vely *= friccion; } } void choque(){ for ( int i=0; i 0 ){ float dD = radio + R - d; float theta = atan2(deltay,deltax); velx += -dD*cos(theta)*M/(masa+M); vely += -dD*sin(theta)*M/(masa+M); velx *= elasticidad; vely *= elasticidad; } } } void desplazamiento(){ x += velx; y += vely; } void display(){ //float c =random(0,1); smooth(); noStroke(); if (c<0.45f) fill(0,0,255); else if (c>=0.45f) fill(255,255,255); ellipse(x,y,radio,radio); if (c<0.45f) fill(255); else if (c>=0.45f) fill(0); // textFont(font, radio*2); // good for alone // text(letra, x-radio/2, y+radio/2); // good for alone textFont(font, radio*1.2); // good for in ellipse text(letra, x-radio/3, y+radio/2.5); // good for in ellipse } } class Point2D { float x; float y; Point2D (){ x = this.x; y = this.y; } Point2D (float X,float Y){ x = X; y = Y; } void display(){ ellipseMode(CENTER_RADIUS); ellipse(x, y, 2, 2); } }