10
votes
Error: "make: *** No rule to make target `mario'. Stop."
I thought I was in the correct directory, but I wasn't. (I’m a super newbie.)
Execute to show what workspace you’re in “print working directory”:
pwd
Execute to "list":
ls
Execute to “change ...
9
votes
Can't submit or check
Had similar problem with similar message. This is how we found out what was wrong:
Executed check50 -h to see what logging options there were. Discovered we can turn on debug logging using --log-...
6
votes
Accepted
pset1 - "greedy" failing at one value
This is a very common problem and the whole point of greedy.c, so let me try and give the definitive answer.
Float values with a decimal part (to the right of the decimal, in case you weren't certain)...
6
votes
Accepted
CS50 IDE undefined reference to `get_int'
On which version of the workspace are you? The current version as of 2017-11-13 is v125. If update50 doesn't end in an error message, you probably are at that version.
Also, how do you compile? The ...
6
votes
Accepted
Check50 and style50 not working: pset1
So apparently markupsafe was upgraded and soft_unicode does not exist in it anymore. I downgraded markupsafe to 2.0.1 and it fixed the issue for me:
pip install markupsafe==2.0.1
5
votes
Accepted
Convert from dollars to cents
The main problem is how you are storing the initial retrieved value. You are calling GetFloat() and storing the result in owed, a variable of type int. GetFloat() returns a floating point number, ...
5
votes
Accepted
pset1 greedy checking problem
True that check50 is strict about the output. Here is what the instructions say
Incidentally, so that we can automate some tests of your code, we ask that your program’s last line
of output be ...
5
votes
My processor does not support hardware virtualisation for cs50 offline IDE
As far as I know, there's only 2 things needed to compile programs that use the code examples from the CS50 course.
The cs50.h header file, and the cs50 library (linked when -lcs50 is passed to the ...
5
votes
Accepted
pset 1 fatal error: 'studio.h' file not found
This is a small syntax error,
<studio.h>
it should be
<stdio.h>
5
votes
Accepted
Getting error in pset1 mario more
Hmmm, this looks like a unique problem. ;-) check50 expects very exact output. That means that any missing or extra content, like whitespace, prompts, punctuation, characters, spaces, or anything ...
5
votes
Accepted
Cannot Compile - Error Message: *** No rule to make target
From the view of the folder tree on the left we see that the .c files are in a directory under workspace named pset1. At the bottom we see that the compile is being run from the workspace directory. ...
5
votes
Accepted
clang: error: no such file or directory: 'hello.c'
This will happen if you accidentally saved the file name as "hello.c " (with a space following the c).
First, the icon for hello.c in the file tree shows as a text file. It should show as a C file ...
5
votes
pset1 credit, need advice
You could take the number as a string, and access the individual digits as characters (subtract '0' or 48 to obtain their value), or parse the number as a long long int and use for example / and % in ...
5
votes
pset1 mario - declaration shadows a local variable
With your usage of int you're creating a new variable.
Example:
int blocks = 5;
{// Just creating a block, similar to a loop
int blocks = 4; //Variable inside the block
printf("%d\n", blocks); /...
5
votes
Greedy Compiling issue
You have multiple issues.
Firstly, your linker errors undefined reference to ... means the linker can't find the functions you are using. In order to tell clang to link with the cs50 library for ...
5
votes
credit - Why this AMEX and MASTERCARD numbers are considered invalid?
Found it:
American Express starts with 34 or 37,
Master Card starts with 51, 52, 53, 54 or 55.
This makes those two numbers INVALID despite good checksum :)
5
votes
Accepted
pset1 (mario, more) - problem with unwanted leading spaces
What conclusion can be drawn from these two facts?
This loop for (row = 0; row <= height; row++) will generate height + 1 lines of output (0 through height inclusive)
The first output line (ie row ...
4
votes
How do you run the program in the CS50 IDE. I looked at the manual previously described, but no help
Which program are you referring to? Since you tagged pset1, I assume you're referring to "hello." I would suggest reading the "Compiling and Running" section of the readme found here: https://cs50....
4
votes
Login to CS50 IDE
I'm actually taking the course throught edX, try to follow those steps, since I do it every day and never had a problem.
Login to edX:
//
2. Open the Cloud 9 IDE link:
Cloud9 IDE
//
3. Click on ...
4
votes
Accepted
Stuck on PSet1: I have the correct output, but Check50 output says it's wrong
edited question
From the spec:
Take care to left-align the bottom-left corner of the left-hand half-pyramid with the left-hand edge of your terminal window.
In other words, the last line must ...
4
votes
Accepted
pset1.greedy did not use modulo
In programming, there are often several ways to do the same task. If they work, they are "correct". But now, you need to start thinking about efficiency. In these assignments, the efficiency is ...
4
votes
Accepted
Pset1 error: expected identifier or '('
The body of the main function must go between keys, the compiler interprets that as the keys are missing, declaring a function before main (this will be seen later) the solution is simple:
int main(...
4
votes
Why am I getting this error message? (integer.c:7:10: error: expected ';' at end of declaration)
The C syntax for variable declaration and value assignment in a single declaration is as follows
int variable_name = value;
The get_int() function returns the int equivalent to the line read from ...
4
votes
Accepted
Error of Undeclared Identifier in the for loop
In order to understand why your code is wrong and how you can fix it, you should first understand the concept of variables.
Before you can assign a value to a variable, you have to declare it, which ...
4
votes
Accepted
I keep getting "expected EOF" when I use check50
When the code is run with the test data that check50 uses, 4111111111111113, it prints INVALID twice. check50 was expecting the program to end, not to print the second INVALID.
The problem is obvious ...
4
votes
Accepted
pset 1 - cash problem - No errors, am rounding, but still not always correct amount of coins
'while (cent >= 0.25)' here you have accidentally written dollar amount instead of cents.
4
votes
pset1 cash 2022
Looks like you are using the 2022 version of check against the 2021 version of pset1 cash. The 2022 version of the pset has a new function to implement called get_cents. (There may be other ...
4
votes
Accepted
variable used in loop condition not modifies in loop body
Well, I had to think carefully about what the code is doing. That mostly comes from not using a best practice.
Here's the best-practice guideline on whether to use a FOR loop or a WHILE loop. When ...
3
votes
Accepted
Modulo operator on greedy?
When you code for greedy, you'll need to do two things as you're counting the coins. You need to figure out how many coins of a given denomination (quarters, dimes, etc.) are needed and then how much ...
3
votes
Accepted
Pset1 Mario- Can't put the user value in to loop!
If it is asking for the number again after building the pyramid, then you have a structure problem. Most likely, you didn't end the loop before starting to build the pyramid, or you've put the whole ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
pset1 × 1184mario × 357
greedy × 223
credit × 103
cs50x × 92
check50 × 79
cash × 77
c × 63
error × 38
mario.less × 28
cs50-pset1 × 22
water × 17
hacker1 × 16
water.c × 16
cash.c × 16
pset1-credit × 16
pyramid × 14
round × 14
credit.c × 14
for-loop × 13
loop × 13
appliance × 12
less × 12
cs50-ide × 11
help × 11