Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void mousePressed() {
- if (looping) noLoop();
- else loop();
- }
- int value1=200;
- int value=0;
- int X;
- int[] nums;
- int[] nums1;
- int count;
- int count1;
- float bx=30;
- float by=130;
- float by1=330;
- int boxSize = 20;
- boolean overBox = false;
- boolean locked = false;
- int randomSignum() {
- return (int) random(2);
- }
- void setup() {
- size(400, 400);
- rectMode(RADIUS);
- }
- void keyPressed() {
- if (value == 200) {
- value = 0;
- } else {
- value = 200*randomSignum();
- }
- if (value == 200 ) {
- value1 = 0;
- } else {
- value1 = 200;
- }
- X=400;
- }
- void draw() {
- background(255);
- fill(0);
- stroke(0);
- strokeWeight(5);
- frameRate(10);
- rect(0, 10, X, 400);
- X=X-5;
- String fresh[]=loadStrings("fake.txt");
- String freshSplit[] = fresh[0].split(" ");
- count=frameCount%(freshSplit.length-40);
- int[] nums = new int[freshSplit.length];
- for (int i = 0; i < freshSplit.length; ++i) {
- nums[i] = Integer.parseInt(freshSplit[i]);
- }
- String fresh1[]=loadStrings("real.txt");
- String freshSplit1[] = fresh1[0].split(" ");
- count1=frameCount%(freshSplit1.length-40);
- int[] nums1 = new int[freshSplit1.length];
- for (int i = 0; i < freshSplit1.length; ++i) {
- nums1[i] = Integer.parseInt(freshSplit1[i]);
- if (mouseX > bx-boxSize && mouseX < bx+boxSize &&
- mouseY > by-boxSize && mouseY < by+boxSize) {
- overBox = true;
- if (!locked) {
- stroke(255);
- fill (0, (nums1[0]+1)*value1, 0);
- }
- } else {
- stroke(153);
- fill(153);
- overBox = false;
- }
- rect(bx, by, boxSize, boxSize, 7);
- if (mouseX > bx-boxSize && mouseX < bx+boxSize &&
- mouseY > by1-boxSize && mouseY < by1+boxSize) {
- overBox = true;
- if (!locked) {
- stroke(255);
- fill (0, (nums[0]+1)*value, 0);
- }
- } else {
- stroke(153);
- fill(153);
- overBox = false;
- }
- // Draw the box
- rect(bx, by1, boxSize, boxSize, 7);
- }
- {
- stroke(0);
- line(0, value+nums1[39], 10, value+nums1[0+count1]) ;
- line(10, value+nums1[0+count1], 20, value+nums1[1+count1]) ;
- line(20, value+nums1[1+count1], 30, value+nums1[2+count1]) ;
- line(30, value+nums1[2+count1], 40, value+nums1[3+count1]) ;
- line(40, value+nums1[3+count1], 50, value+nums1[4+count1]) ;
- line(50, value+nums1[4+count1], 60, value+nums1[5+count1]) ;
- line(60, value+nums1[5+count1], 70, value+nums1[6+count1]) ;
- line(70, value+nums1[6+count1], 80, value+nums1[7+count1]) ;
- line(80, value+nums1[7+count1], 90, value+nums1[8+count1]) ;
- line(90, value+nums1[8+count1], 100, value+nums1[9+count1]) ;
- line(100, value+nums1[9+count1], 110, value+nums1[10+count1]) ;
- line(110, value+nums1[10+count1], 120, value+nums1[11+count1]) ;
- line(120, value+nums1[11+count1], 130, value+nums1[12+count1]) ;
- line(130, value+nums1[12+count1], 140, value+nums1[13+count1]) ;
- line(140, value+nums1[13+count1], 150, value+nums1[14+count1]) ;
- line(150, value+nums1[14+count1], 160, value+nums1[15+count1]) ;
- line(160, value+nums1[15+count1], 170, value+nums1[16+count1]) ;
- line(170, value+nums1[16+count1], 180, value+nums1[17+count1]) ;
- line(180, value+nums1[17+count1], 190, value+nums1[18+count1]) ;
- line(190, value+nums1[18+count1], 200, value+nums1[19+count1]) ;
- line(200, value+nums1[19+count1], 210, value+nums1[20+count1]) ;
- line(210, value+nums1[20+count1], 220, value+nums1[21+count1]) ;
- line(220, value+nums1[21+count1], 230, value+nums1[22+count1]) ;
- line(230, value+nums1[22+count1], 240, value+nums1[23+count1]) ;
- line(240, value+nums1[23+count1], 250, value+nums1[24+count1]) ;
- line(250, value+nums1[24+count1], 260, value+nums1[25+count1]) ;
- line(260, value+nums1[25+count1], 270, value+nums1[26+count1]) ;
- line(270, value+nums1[26+count1], 280, value+nums1[27+count1]) ;
- line(280, value+nums1[27+count1], 290, value+nums1[28+count1]) ;
- line(290, value+nums1[28+count1], 300, value+nums1[29+count1]) ;
- line(300, value+nums1[29+count1], 310, value+nums1[30+count1]) ;
- line(310, value+nums1[30+count1], 320, value+nums1[31+count1]) ;
- line(320, value+nums1[31+count1], 330, value+nums1[32+count1]) ;
- line(330, value+nums1[32+count1], 340, value+nums1[33+count1]) ;
- line(340, value+nums1[33+count1], 350, value+nums1[34+count1]) ;
- line(350, value+nums1[34+count1], 360, value+nums1[35+count1]) ;
- line(360, value+nums1[35+count1], 370, value+nums1[36+count1]) ;
- line(370, value+nums1[36+count1], 380, value+nums1[37+count1]) ;
- line(380, value+nums1[37+count1], 390, value+nums1[38+count1]) ;
- line(390, value+nums1[38+count1], 400, value+nums1[39+count1]) ;
- stroke(0);
- line(0, value1+nums[39], 10, value1+nums[0+count]) ;
- line(10, value1+nums[0+count], 20, value1+nums[1+count]) ;
- line(20, value1+nums[1+count], 30, value1+nums[2+count]) ;
- line(30, value1+nums[2+count], 40, value1+nums[3+count]) ;
- line(40, value1+nums[3+count], 50, value1+nums[4+count]) ;
- line(50, value1+nums[4+count], 60, value1+nums[5+count]) ;
- line(60, value1+nums[5+count], 70, value1+nums[6+count]) ;
- line(70, value1+nums[6+count], 80, value1+nums[7+count]) ;
- line(80, value1+nums[7+count], 90, value1+nums[8+count]) ;
- line(90, value1+nums[8+count], 100, value1+nums[9+count]) ;
- line(100, value1+nums[9+count], 110, value1+nums[10+count]) ;
- line(110, value1+nums[10+count], 120, value1+nums[11+count]) ;
- line(120, value1+nums[11+count], 130, value1+nums[12+count]) ;
- line(130, value1+nums[12+count], 140, value1+nums[13+count]) ;
- line(140, value1+nums[13+count], 150, value1+nums[14+count]) ;
- line(150, value1+nums[14+count], 160, value1+nums[15+count]) ;
- line(160, value1+nums[15+count], 170, value1+nums[16+count]) ;
- line(170, value1+nums[16+count], 180, value1+nums[17+count]) ;
- line(180, value1+nums[17+count], 190, value1+nums[18+count]) ;
- line(190, value1+nums[18+count], 200, value1+nums[19+count]) ;
- line(200, value1+nums[19+count], 210, value1+nums[20+count]) ;
- line(210, value1+nums[20+count], 220, value1+nums[21+count]) ;
- line(220, value1+nums[21+count], 230, value1+nums[22+count]) ;
- line(230, value1+nums[22+count], 240, value1+nums[23+count]) ;
- line(240, value1+nums[23+count], 250, value1+nums[24+count]) ;
- line(250, value1+nums[24+count], 260, value1+nums[25+count]) ;
- line(260, value1+nums[25+count], 270, value1+nums[26+count]) ;
- line(270, value1+nums[26+count], 280, value1+nums[27+count]) ;
- line(280, value1+nums[27+count], 290, value1+nums[28+count]) ;
- line(290, value1+nums[28+count], 300, value1+nums[29+count]) ;
- line(300, value1+nums[29+count], 310, value1+nums[30+count]) ;
- line(310, value1+nums[30+count], 320, value1+nums[31+count]) ;
- line(320, value1+nums[31+count], 330, value1+nums[32+count]) ;
- line(330, value1+nums[32+count], 340, value1+nums[33+count]) ;
- line(340, value1+nums[33+count], 350, value1+nums[34+count]) ;
- line(350, value1+nums[34+count], 360, value1+nums[35+count]) ;
- line(360, value1+nums[35+count], 370, value1+nums[36+count]) ;
- line(370, value1+nums[36+count], 380, value1+nums[37+count]) ;
- line(380, value1+nums[37+count], 390, value1+nums[38+count]) ;
- line(390, value1+nums[38+count], 400, value1+nums[39+count]) ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement