These are chat archives for FreeCodeCamp/Help

1st
Feb 2015
GrahamFischer
@GrahamFischer
Feb 01 2015 02:02
I'm a bit stuck on a challenge and I'm wondering if anyone can help
Patrick Ly
@patrickly
Feb 01 2015 02:37
@GrahamFischer which challenge?
Jimmy Bryant II
@JimBry
Feb 01 2015 02:48
Could anyone help me with Week 3 Q1 of the Image Bluescreen Exercises on Stanfords CS101 I answered the second question correctly I just can't seem to get the first one.
Here is my code:
image = new SimpleImage("striped-fish-green.jpg");
back = new SimpleImage("yosemite.jpg");
back.setSameSize(image);

for (pixel: image) {
  avg = (pixel.getRed() + pixel.getGreen() + pixel.getBlue())/3;
  // your code here
  if (pixel.getGreen() > avg * 1.01) {

    pixel2 = back.getPixel(pixel.getX(), pixel.getY());


    pixel.setRed(pixel2.getRed());
    pixel.setGreen(pixel2.getBlue());
    pixel.setBlue(pixel2.getBlue());
  }

}
print(image);
Patrick Ly
@patrickly
Feb 01 2015 03:08
@JimBry you put .getBlue() twice.
@JimBry pixel.setGreen(pixel2.getGreen());
@JimBry
image = new SimpleImage("striped-fish-green.jpg");
back = new SimpleImage("yosemite.jpg");
back.setSameSize(image);

for (pixel: image) {
  avg = (pixel.getRed() + pixel.getGreen() + pixel.getBlue())/3;
  // your code here
  if (pixel.getGreen() > avg * 1.01) {

    pixel2 = back.getPixel(pixel.getX(), pixel.getY());


    pixel.setRed(pixel2.getRed());
    pixel.setGreen(pixel2.getGreen());
    pixel.setBlue(pixel2.getBlue());
  }

}
print(image);
Jimmy Bryant II
@JimBry
Feb 01 2015 03:11
@patrickly thanks that slipped by me!
Patrick Ly
@patrickly
Feb 01 2015 03:12
@JimBry no problem!