daily pastebin goal
9%
SHARE
TWEET

string compare

fifthmonarchyman Oct 17th, 2015 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void mousePressed() {
  2.   if (looping)    noLoop();
  3.   else            loop();
  4. }
  5. int value1=200;
  6. int value=0;
  7. int X;
  8. int[] nums;
  9. int[] nums1;
  10. int count;
  11. int count1;
  12. float bx=30;
  13. float by=130;
  14. float by1=330;
  15. int boxSize = 20;
  16. boolean overBox = false;
  17. boolean locked = false;
  18.  
  19. int randomSignum() {
  20.   return (int) random(2);
  21. }
  22. void setup() {
  23.   size(400, 400);
  24.   rectMode(RADIUS);
  25. }
  26.  
  27.  
  28. void keyPressed() {
  29.  
  30.   if (value == 200) {
  31.     value = 0;
  32.   } else {
  33.     value = 200*randomSignum();
  34.   }
  35.   if (value == 200 ) {
  36.     value1 = 0;
  37.   } else {
  38.     value1 = 200;
  39.   }
  40.   X=400;
  41. }
  42.  
  43. void draw() {
  44.   background(255);  
  45.   fill(0);
  46.   stroke(0);
  47.   strokeWeight(5);
  48.   frameRate(10);
  49.   rect(0, 10, X, 400);
  50.   X=X-5;
  51.  
  52.   String fresh[]=loadStrings("fake.txt");
  53.   String freshSplit[] = fresh[0].split(" ");
  54.   count=frameCount%(freshSplit.length-40);
  55.   int[] nums = new int[freshSplit.length];
  56.   for (int i = 0; i < freshSplit.length; ++i) {
  57.     nums[i] = Integer.parseInt(freshSplit[i]);
  58.   }
  59.   String fresh1[]=loadStrings("real.txt");
  60.   String freshSplit1[] = fresh1[0].split(" ");
  61.   count1=frameCount%(freshSplit1.length-40);
  62.   int[] nums1 = new int[freshSplit1.length];
  63.   for (int i = 0; i < freshSplit1.length; ++i) {
  64.     nums1[i] = Integer.parseInt(freshSplit1[i]);
  65.  
  66.     if (mouseX > bx-boxSize && mouseX < bx+boxSize &&
  67.       mouseY > by-boxSize && mouseY < by+boxSize) {
  68.       overBox = true;  
  69.       if (!locked) {
  70.         stroke(255);
  71.         fill (0, (nums1[0]+1)*value1, 0);
  72.       }
  73.     } else {
  74.       stroke(153);
  75.       fill(153);
  76.       overBox = false;
  77.     }
  78.     rect(bx, by, boxSize, boxSize, 7);
  79.     if (mouseX > bx-boxSize && mouseX < bx+boxSize &&
  80.       mouseY > by1-boxSize && mouseY < by1+boxSize) {
  81.       overBox = true;  
  82.       if (!locked) {
  83.         stroke(255);
  84.         fill (0, (nums[0]+1)*value, 0);
  85.       }
  86.     } else {
  87.       stroke(153);
  88.       fill(153);
  89.       overBox = false;
  90.     }
  91.     // Draw the box
  92.  
  93.     rect(bx, by1, boxSize, boxSize, 7);
  94.   }
  95.  
  96.   {
  97.     stroke(0);
  98.     line(0, value+nums1[39], 10, value+nums1[0+count1]) ;
  99.     line(10, value+nums1[0+count1], 20, value+nums1[1+count1]) ;
  100.     line(20, value+nums1[1+count1], 30, value+nums1[2+count1]) ;
  101.     line(30, value+nums1[2+count1], 40, value+nums1[3+count1]) ;
  102.     line(40, value+nums1[3+count1], 50, value+nums1[4+count1]) ;
  103.     line(50, value+nums1[4+count1], 60, value+nums1[5+count1]) ;
  104.     line(60, value+nums1[5+count1], 70, value+nums1[6+count1]) ;
  105.     line(70, value+nums1[6+count1], 80, value+nums1[7+count1]) ;
  106.     line(80, value+nums1[7+count1], 90, value+nums1[8+count1]) ;
  107.     line(90, value+nums1[8+count1], 100, value+nums1[9+count1]) ;
  108.     line(100, value+nums1[9+count1], 110, value+nums1[10+count1]) ;
  109.     line(110, value+nums1[10+count1], 120, value+nums1[11+count1]) ;
  110.     line(120, value+nums1[11+count1], 130, value+nums1[12+count1]) ;
  111.     line(130, value+nums1[12+count1], 140, value+nums1[13+count1]) ;
  112.     line(140, value+nums1[13+count1], 150, value+nums1[14+count1]) ;
  113.     line(150, value+nums1[14+count1], 160, value+nums1[15+count1]) ;
  114.     line(160, value+nums1[15+count1], 170, value+nums1[16+count1]) ;
  115.     line(170, value+nums1[16+count1], 180, value+nums1[17+count1]) ;
  116.     line(180, value+nums1[17+count1], 190, value+nums1[18+count1]) ;
  117.     line(190, value+nums1[18+count1], 200, value+nums1[19+count1]) ;
  118.     line(200, value+nums1[19+count1], 210, value+nums1[20+count1]) ;
  119.     line(210, value+nums1[20+count1], 220, value+nums1[21+count1]) ;
  120.     line(220, value+nums1[21+count1], 230, value+nums1[22+count1]) ;
  121.     line(230, value+nums1[22+count1], 240, value+nums1[23+count1]) ;
  122.     line(240, value+nums1[23+count1], 250, value+nums1[24+count1]) ;
  123.     line(250, value+nums1[24+count1], 260, value+nums1[25+count1]) ;
  124.     line(260, value+nums1[25+count1], 270, value+nums1[26+count1]) ;
  125.     line(270, value+nums1[26+count1], 280, value+nums1[27+count1]) ;
  126.     line(280, value+nums1[27+count1], 290, value+nums1[28+count1]) ;
  127.     line(290, value+nums1[28+count1], 300, value+nums1[29+count1]) ;
  128.     line(300, value+nums1[29+count1], 310, value+nums1[30+count1]) ;
  129.     line(310, value+nums1[30+count1], 320, value+nums1[31+count1]) ;
  130.     line(320, value+nums1[31+count1], 330, value+nums1[32+count1]) ;
  131.     line(330, value+nums1[32+count1], 340, value+nums1[33+count1]) ;
  132.     line(340, value+nums1[33+count1], 350, value+nums1[34+count1]) ;
  133.     line(350, value+nums1[34+count1], 360, value+nums1[35+count1]) ;
  134.     line(360, value+nums1[35+count1], 370, value+nums1[36+count1]) ;
  135.     line(370, value+nums1[36+count1], 380, value+nums1[37+count1]) ;
  136.     line(380, value+nums1[37+count1], 390, value+nums1[38+count1]) ;
  137.     line(390, value+nums1[38+count1], 400, value+nums1[39+count1]) ;
  138.     stroke(0);
  139.     line(0, value1+nums[39], 10, value1+nums[0+count]) ;
  140.     line(10, value1+nums[0+count], 20, value1+nums[1+count]) ;
  141.     line(20, value1+nums[1+count], 30, value1+nums[2+count]) ;
  142.     line(30, value1+nums[2+count], 40, value1+nums[3+count]) ;
  143.     line(40, value1+nums[3+count], 50, value1+nums[4+count]) ;
  144.     line(50, value1+nums[4+count], 60, value1+nums[5+count]) ;
  145.     line(60, value1+nums[5+count], 70, value1+nums[6+count]) ;
  146.     line(70, value1+nums[6+count], 80, value1+nums[7+count]) ;
  147.     line(80, value1+nums[7+count], 90, value1+nums[8+count]) ;
  148.     line(90, value1+nums[8+count], 100, value1+nums[9+count]) ;
  149.     line(100, value1+nums[9+count], 110, value1+nums[10+count]) ;
  150.     line(110, value1+nums[10+count], 120, value1+nums[11+count]) ;
  151.     line(120, value1+nums[11+count], 130, value1+nums[12+count]) ;
  152.     line(130, value1+nums[12+count], 140, value1+nums[13+count]) ;
  153.     line(140, value1+nums[13+count], 150, value1+nums[14+count]) ;
  154.     line(150, value1+nums[14+count], 160, value1+nums[15+count]) ;
  155.     line(160, value1+nums[15+count], 170, value1+nums[16+count]) ;
  156.     line(170, value1+nums[16+count], 180, value1+nums[17+count]) ;
  157.     line(180, value1+nums[17+count], 190, value1+nums[18+count]) ;
  158.     line(190, value1+nums[18+count], 200, value1+nums[19+count]) ;
  159.     line(200, value1+nums[19+count], 210, value1+nums[20+count]) ;
  160.     line(210, value1+nums[20+count], 220, value1+nums[21+count]) ;
  161.     line(220, value1+nums[21+count], 230, value1+nums[22+count]) ;
  162.     line(230, value1+nums[22+count], 240, value1+nums[23+count]) ;
  163.     line(240, value1+nums[23+count], 250, value1+nums[24+count]) ;
  164.     line(250, value1+nums[24+count], 260, value1+nums[25+count]) ;
  165.     line(260, value1+nums[25+count], 270, value1+nums[26+count]) ;
  166.     line(270, value1+nums[26+count], 280, value1+nums[27+count]) ;
  167.     line(280, value1+nums[27+count], 290, value1+nums[28+count]) ;
  168.     line(290, value1+nums[28+count], 300, value1+nums[29+count]) ;
  169.     line(300, value1+nums[29+count], 310, value1+nums[30+count]) ;
  170.     line(310, value1+nums[30+count], 320, value1+nums[31+count]) ;
  171.     line(320, value1+nums[31+count], 330, value1+nums[32+count]) ;
  172.     line(330, value1+nums[32+count], 340, value1+nums[33+count]) ;
  173.     line(340, value1+nums[33+count], 350, value1+nums[34+count]) ;
  174.     line(350, value1+nums[34+count], 360, value1+nums[35+count]) ;
  175.     line(360, value1+nums[35+count], 370, value1+nums[36+count]) ;
  176.     line(370, value1+nums[36+count], 380, value1+nums[37+count]) ;
  177.     line(380, value1+nums[37+count], 390, value1+nums[38+count]) ;
  178.     line(390, value1+nums[38+count], 400, value1+nums[39+count]) ;
  179.   }
  180. }
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