Hot answers tagged

3 votes

Pset4 filter edges issue

I found the solution, it turns out I was supposed to create a copy of the original image to work on.
Marianna's user avatar
3 votes

Choosing pixels in resize (More)

I'm dealing with that at the moment, and as far as I can tell the form is newArray[i] = oldArray[(int)floor(i / factor)] Then, if factor = 0.5 floor(0/0.5) = 0 /* newArray[0] = oldArray[0] */ floor(...
bluesmonk's user avatar
  • 131
2 votes
Accepted

pset6 (Similarities, more)

De acuerdo a las especificaciones: Stored in each element of the matrix should be a tuple, (cost, operation), where cost is an int and operation is an Operation. So what does the line of code ...
MARS's user avatar
  • 5,169
2 votes
Accepted

PSET6 Similarities (More) 500 Internal Server Error

except for the first element, which is supposed to have no operation, but I gave it an Operation.SUBSTITUTED And this is probably the problem, since that operation subtracts 1 from i and j, which ...
curiouskiwi's user avatar
  • 18.6k
2 votes

Pset4 filter edges issue

The code you used does not create a separate temporary memory for the changes that you make to the image. As your code uses data stored in previous pixel as reference to edit the image, it creates a ...
Crisp_Coder99's user avatar
1 vote
Accepted

PSET4 - Filter(more)- Edges- Check50 error

Here's a really big hint. The right edge and bottom edge pixels are all bad, but the left and top are OK (except top right and bottom left). Have you taken a careful look at the limits for the right ...
Cliff B's user avatar
  • 68.7k
1 vote
Accepted

mario more (python)

Look at the print line: print(f" " * spaces, "#" * (i + 1), "", "#" * j) Python will print a space after each element (ie, each item separated from the ...
Cliff B's user avatar
  • 68.7k
1 vote

mario more (python)

There are multiple issues with the code. The height has to be between 1 and 8 inclusive. Your code will not allow a height of 8. Also, the user should be asked for the height until a proper number is ...
Vsjain's user avatar
  • 1,016
1 vote
Accepted

Cannot understand why valgrind is giving error although check50 runs properly

It looks like your blur function is trying to access a non-existent pixel at image[height-1][width]. If so, that's probably not the only reference outside the boundary of image.
glennholloway's user avatar
1 vote
Accepted

Why isn't resize(more) printing properly?

It looks to me like the code is writing the output padding after factor lines have been written out, not after EACH line. Say that factor is 3. The code writes out the current line of pixels out 3 ...
Cliff B's user avatar
  • 68.7k
1 vote
Accepted

Random Black Pixels on Resize More

Your problem is different than what you think it is. You don't seem to have scratched the surface. Have you watched the walkthrough? First, you don't change all the headers you need to change, and ...
Blauelf's user avatar
  • 20.9k
1 vote
Accepted

pset6 similarites more distances wrong operations

I think your insertCost is actually your deleteCost and the other way around.
Blauelf's user avatar
  • 20.9k
1 vote
Accepted

Pset6 Sentimental Mario (more) check50 fails with correct output

The output shown makes no sense to me, but int will throw an error if the value is not the representation of an integer. You can for example use it like while True: user_input = input("Height: ")...
Blauelf's user avatar
  • 20.9k
1 vote

Pset 2 initials output correct - check50 displays error

No, the output is not correct, not in all cases. Look closely at how the code executes. The outer for loop appears to be intended to count the letters consumed in the name string, but because of the ...
Cliff B's user avatar
  • 68.7k

Only top scored, non community-wiki answers of a minimum length are eligible