[-] [email protected] 1 points 2 months ago

The idiom allowed it to pass the checker's tests! Thanks for your help!

[-] [email protected] 1 points 2 months ago* (last edited 2 months ago)

It's for CS50P which uses a customized VS Code. It has an automated code checker which I ran when I was done.

outputs "Just right!" when guess is correct

timed out while waiting for program to exit

[-] [email protected] 1 points 2 months ago

Was using tabs but I went through it to make sure and seemed to be ok.

[-] [email protected] 1 points 2 months ago

Thanks for the additional info. Maybe I will opt for the developer version instead in that case.

[-] [email protected] 1 points 2 months ago

Yup no issues here

[-] [email protected] 1 points 3 months ago

Yes I did eventually think of that as well but just wanted to understand why '|' wasn't producing the results I expected.

[-] [email protected] 1 points 3 months ago

I did come across that link but didn't quite understand it. If looking only at 25 | 10, does the code not run as expected because 25 is 5 digits long and 10 is 4 digits long? Is that what's meant by "two equivalent length bit designs"?

Also, I can't tell if 10 | 4 = 7 or 10 | 4 = 14.

[-] [email protected] 1 points 2 years ago

Yes, that helps. Thanks. I see now how n goes from 1 to 2 to 3...etc. Now not so sure how i = 1 when the for loop starts.

[-] [email protected] 1 points 2 years ago

Gotcha. Thanks for the explanation.

[-] [email protected] 1 points 2 years ago

I see. I guess my understanding was that the recursion was over after the recursive call, but it's actually for all the code in draw().

[-] [email protected] 1 points 2 years ago

Thanks. I did see that. I have a general understanding of how recursion works I think where the function calls itself again and again but I don't get why the code (for loop) below the draw(n - 1) is recursive.

view more: ‹ prev next ›

milon

0 post score
0 comment score
joined 2 years ago