CODE

From DigitalCraft_Wiki
Revision as of 22:21, 9 November 2015 by KvdH (talk | contribs) (Created page with "int xPos; int yPos; void setup () { size(538, 1081); background(255); stroke(255); String lines[] = loadStrings("cover.txt"); for (int x =0; x < lines.length; ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

int xPos; int yPos;


void setup () {

 size(538, 1081);
 background(255);
 stroke(255);
 String lines[] = loadStrings("cover.txt");


 for (int x =0; x < lines.length; x++) {
   for (int i = 0; i < lines[x].length (); i++) {
     yPos = yPos + 12 ;
     char letter = (lines[x].charAt(i));
     if (letter == 'a') {
       fill(255, 255, 0);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'b') {
       fill(184, 255, 185);
       rect(xPos, yPos, 12, 12);
     }


     if (letter == 'c') {
       fill(255, 0, 128);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'd') {
       fill(203, 84, 84);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'e') {
       fill(0, 255, 255);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'f') {
       fill(95, 0, 95);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'g') {
       fill(204, 205, 0);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'h') {
       fill(55, 55, 255);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'i') {
       fill(255, 0, 0);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'j') {
       fill(0, 106, 0);
       rect(xPos, yPos, 12, 12);
     }  
     if (letter == 'k') {
       fill(0, 128, 192);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'l') {
       fill(185, 185, 255);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'm') {
       fill(124, 185, 255);
       rect(xPos, yPos, 12, 12);
     }  
     if (letter == 'n') {
       fill(117, 0, 117);
       rect(xPos, yPos, 12, 12);
     }  
     if (letter == 'o') {
       fill(185, 69, 255);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'p') {
       fill(192, 192, 134);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'q') {
       fill(255, 255, 100);
       rect(xPos, yPos, 12, 12);
     }  
     if (letter == 'r') {
       fill(185, 124, 255);
       rect(xPos, yPos, 12, 12);
     } 
     if (letter == 's') {
       fill(145, 0, 72);
       rect(xPos, yPos, 12, 12);
     } 
     if (letter == 't') {
       fill(145, 145, 0);
       rect(xPos, yPos, 12, 12);
     }  
     if (letter == 'u') {
       fill(0, 255, 0);
       rect(xPos, yPos, 12, 12);
     }  
     if (letter == 'v') {
       fill(139, 139, 139);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'w') {
       fill(222, 255, 2);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'x') {
       fill(0, 128, 64);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'y') {
       fill(255, 124, 26);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'z') {
       fill(114, 49, 46);
       rect(xPos, yPos, 12, 12);
     }


     if (letter == 'A') {
       fill(255, 255, 0);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'B') {
       fill(184, 255, 185);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'C') {
       fill(255, 0, 128);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'D') {
       fill(203, 84, 84);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'E') {
       fill(0, 255, 255);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'F') {
       fill(95, 0, 95);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'G') {
       fill(204, 205, 0);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'H') {
       fill(55, 55, 255);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'I') {
       fill(255, 0, 0);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'J') {
       fill(0, 106, 0);
       rect(xPos, yPos, 12, 12);
     }  
     if (letter == 'K') {
       fill(0, 128, 192);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'L') {
       fill(185, 185, 255);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'M') {
       fill(124, 185, 255);
       rect(xPos, yPos, 12, 12);
     }  
     if (letter == 'N') {
       fill(117, 0, 117);
       rect(xPos, yPos, 12, 12);
     }  
     if (letter == 'O') {
       fill(185, 69, 255);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'P') {
       fill(192, 192, 134);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'Q') {
       fill(255, 255, 100);
       rect(xPos, yPos, 12, 12);
     } 
     if (letter == 'R') {
       fill(185, 124, 255);
       rect(xPos, yPos, 12, 12);
     } 
     if (letter == 'S') {
       fill(145, 0, 72);
       rect(xPos, yPos, 12, 12);
     } 
     if (letter == 'T') {
       fill(145, 145, 0);
       rect(xPos, yPos, 12, 12);
     }  
     if (letter == 'U') {
       fill(0, 255, 0);
       rect(xPos, yPos, 12, 12);
     }  
     if (letter == 'V') {
       fill(139, 139, 139);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'W') {
       fill(222, 255, 2);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'X') {
       fill(0, 128, 64);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'Y') {
       fill(255, 124, 26);
       rect(xPos, yPos, 12, 12);
     }
     if (letter == 'Z') {
       fill(114, 49, 46);
       rect(xPos, yPos, 12, 12);
     }



     if (letter == '!') {
       fill(203, 84, 84);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == '?') {
       fill(117, 0, 117);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == '.') {
       fill(255, 0, 128);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == ',') {
       fill(185, 124, 255);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == ':') {
       fill(0, 128, 192);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == '"') {
       fill(124, 185, 255);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == '/') {
       fill(184,255,185);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }



     if (letter == '1') {
       fill(255, 157, 157);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == '2') {
       fill(255, 204, 0);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == '3') {
       fill(128, 64, 64);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == '4') {
       fill(255, 124, 26);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == '5') {
       fill(0.64, 128);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == '6') {
       fill(255, 255, 172);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == '7') {
       fill(0.147, 147);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == '8') {
       fill(179, 152, 103);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == '9') {
       fill(0.81, 0);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
     if (letter == '0') {
       fill(148, 183, 186);
       ellipse(xPos+6, yPos + 6, 12, 12);
     }
   }
   yPos=0;
   xPos=xPos+25;
   save("wiki.jpg");
   //PImage newImage = createImage(538, 1081,RGB);
   //newImage.save("hallo.jpg");
 }

}