6 votes

pset7 fractions being rejected causing Buy to fail

SOLVED. I added the following: try: shares = int(request.form.get("shares")) except ValueError: return apology("shares must be a posative integer", 400) I was under the impression that, ...
  • 81
3 votes
Accepted

pset5 speller works, check50 fails, segfault with small dictionary

Think about what's happening. When using the full dictionary, there are words for every letter of the alphabet. Since your hashmax is 32, there's also a really good chance that every possible hash ...
  • 66.7k
3 votes
Accepted

Caesar Working as Expected - Check50 glitched?

This is an easy one. How is "ciphertext" supposed to be spelled, according to the spec? And is it supposed to be capitalized? Very important lesson here. When given a spec, you need to write the ...
  • 66.7k
3 votes

cs50p problemset 7 /working.py

This scenario has been described in the CS50 Python ED forum. When you get this error message: :( correct working.py passes all test_working checks expected exit code 0, not 1 It means check50 is ...
  • 624
2 votes
Accepted

PSet3 Find passing my testing but failing check50

What bool does 0 represnet - true or false? Your search() routine returns a bool, meaning either true or false. However, you have fallen into the trap of using numbers instead of true or false. The ...
  • 66.7k
2 votes
Accepted

Pset 6 server.c, Check50 does not work

These three failed tests should give you a hint that it's testing the code you wrote for indexes. :( Requesting /test redirects to /test/ :( Requesting /test/ outputs /test/index.html :...
2 votes
Accepted

Doesn't pass the last test

check50 actually uses a different data set for testing, so it is working correctly. (Sneaky of them, isn't it? ;-) It's because of a series of issues over time and is a long story. ) As for not ...
  • 66.7k
2 votes
Accepted

Pset2, Vigenere error "\ expected output, not a prompt for input" when I run check50

Your output does not match the spec. The spec says Implement a program that encrypts messages using Vigenère’s cipher, per the below. $ ./vigenere ABC plaintext: HELLO ciphertext: ...
2 votes
Accepted

issues with check50 and erros

In many cases, exact spelling is required, and is found in the problem specification. How else would an automated check test your programmes? If you think check50 does something wrong, please provide ...
  • 20.8k
2 votes
Accepted

Pset2 - Vigenere fails check50 with "expected exit code 0, not 1"

Change your function to a name other than index. Looks like that is getting confused with the index declaration in string.h. (check50 is running a different compile version, which I'll see about ...
  • 18.5k
2 votes
Accepted

pset4 recover - my implementation recovers 50 jpegs but check50 rejects

Prepare for a painful self-headslap. ;-) File names are important. The code created 50 files with the extension .jpeg. The spec said to create files using the extension .jpg, without the "e". ...
  • 66.7k
2 votes
Accepted

PSET 6: Sentimental [Mario.py(less)]: How exactly do I "reject input" in Python as specified in check50?

Remember your C code. Reject in this case means to ask again. Use a loop around the input, and leave it on valid input (via loop condition or break). If the code were in a function, I'd raise an ...
  • 20.8k
2 votes
Accepted

pset7 C$50 finance check50 error expected status code 200, but got 400

This is pointing to a problem with your index.html page. Have you completed your index function? If not, why are you running check50 which should be used as a final check once you've completed the ...
  • 18.5k
2 votes
Accepted

Check50 for caesar, pset2 returns an error "Not valid ASCII text" twice, even though it encrypts correctly for the same text used in check50

I ran your code and got something different than what you posted. After further checking, I found that the results are actually unpredictable. The code may or may not print extra characters after ...
  • 66.7k
2 votes

Pset4 Filter sepia error from check50

just fixed it. so the code was wrote in wrong order and the Ternary Operator was missing a () void sepia(int height, int width, RGBTRIPLE image[height][width]) { for (int i = 0; i < height; i++)...
  • 23
2 votes
Accepted

check50 says i have no output on pset2 substitution, but my code does output correctly

Following on to Cliff's answer, if (argv[i] == argv[k]) You cannot access anything beyond argv[1] because you've already tested that argc is 2, so there are only argv[0] and argv[1]. Your loop is ...
  • 18.5k
1 vote
Accepted

pset 8 finance: ":( buy handles valid purchase" fails

You already use usd in both possible ways, using like usd(price) in Python (bought.html), or {{ price | usd }} in the template (index.html). I think the issue is that the value it searches for is the ...
  • 20.8k
1 vote
Accepted

pset8 finance check50 fails on "checking that "56.00" is in page" even though it is in the page

After reviewing your actual code /sell needs to accept a POST request where shares is a number of shares, and symbol is a stock symbol. Your code has /sell take symbol as the ID of a row in a table ...
  • 18.5k
1 vote
Accepted

pset1 - credit fails check50 compilation with “expected exit code 0, not 1” but compiles locally

Might be you have a slightly different version of cs50 library. On 64 bit Linux (but not on Windows), long long is same as long, both 8 bytes, so somebody decided to deprecate get_long_long (see ...
  • 20.8k
1 vote
Accepted

PSET7: Finance: check50 errors

The first error "quote handles invalid ticker symbol" indicates the quote route gives an error if nothing is returned from lookup. Note this exception raised in application: TypeError: 'NoneType' ...
1 vote
Accepted

Errors while check50 in Pset1 mario less, expecting suggestions

Let's have a look at one of those error messages: :( handles a height of 2 correctly expected " ##\n###\n", not "##\n" This means that for a height of 2, the test expected to get: ## ### while ...
1 vote
Accepted

pset7: check50 error - sell page has all required elements

The issue here is that, when the index.html page is rendered, the lookup function is returning None for the stock (in this particular case, it's because you are converting your symbols to lowercase ...
  • 18.5k
1 vote
Accepted

Pset4 resize code working, headers correct, check50 fails

You use bi.biHeight in your for loop, but that means you are writing bi.biHeight*n lines, that's too many by a factor of n. Easiest fix would be to use bi.biHeight/n instead.
  • 20.8k
1 vote

pset7 C$50 finance check50 error expected status code 200, but got 400

You can "check50" login and register without completing index.html....as long as it doesn't return a 400. If you examine the apology function in helpers.py, you will notice that the code parameter is ...
1 vote
Accepted

Can you help me understand these check50 results?

There is something wrong with your code. In the first screen shot, the issue is that the code didn't reject anything when it should have. In all the later examples, check50 will fail all tests ...
  • 66.7k
1 vote

pset3 fifteen check50 error

It is not complaining about the compile, that gives a :). It is complaining that the board is not initialized correctly. Remember from the check50 section of the spec: Note that check50 assumes ...
1 vote

mario pset1 check50 has errors, but seems fine to me. No?

Pay attention to extra spaces. Check50 expects that yo do exactly what has been asked. If you put extra space, it would look the same for your eyes, but not for check50. I strongly suspect (not sure), ...
  • 1,139
1 vote
Accepted

pset6 - mario more - check50 EOF error

0 and 23 are valid input values. By using >0 and <23 you exclude them. Use >= and <=.
  • 20.8k
1 vote

Pset 7 - Cannot replicate None type not subscritable error

Either: Is lookup always returning something? You could check this before applying a subscript. Reasoning is that Yahoo shut down its API a few weeks ago. Have you updated your helpers.py file? The ...
  • 20.8k
1 vote

Pset5 - Valgrind success, speller output matches staff solution, passes all but the last test on check50

So dict they use is small containing cat caterpillar and text is ca cat cats caterpill caterpillar caterpillars Maybe this helps in reproducing locally, unless they use their own speller.c (which ...
  • 20.8k

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