SHARE
TWEET

Untitled

a guest Jul 16th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. String[] data;
  3. int res;
  4.  
  5. void setup() {
  6.   size(400, 400);
  7.   res = min(width, height)/8;
  8.   data = loadStrings("data.txt");
  9. }
  10.  
  11. void draw() {
  12.   background(255);
  13.   noStroke();
  14.   for (int q = 0; q < 4; q++) {
  15.     String[] quad = split(data[q], " ");
  16.     int i = 0;
  17.     for (String d : quad) {
  18.       int val = int(d);
  19.       fill(val);
  20.       int x = i%4 + (q==1||q==3?4:0);
  21.       int y = i/4 + (q==2||q==3?4:0);
  22.       rect(x*res, y*res, res, res);
  23.       i++;
  24.     }
  25.   }
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top