Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check50 mario more rejections #297

Closed
Jan-69 opened this issue Feb 5, 2023 · 1 comment
Closed

Check50 mario more rejections #297

Jan-69 opened this issue Feb 5, 2023 · 1 comment

Comments

@Jan-69
Copy link

Jan-69 commented Feb 5, 2023

Hi,
I'm running mario-more (which behaves as expected), through check 50 and I'm getting rejections, if I will change the program according to the suggestions in the check50, the pyramids will be skewed. What am I missing?
Issue1

#include <stdio.h>
#include <cs50.h>

int get_size(void);
void print_dots(int size);
void print_hash(int size);

int main(void)
{
int i = get_size(); //get size from user

for (int r = 1; r <= i; r++) // repeat printing
{
print_dots(r);
print_hash(r);
print_dots(6);
print_hash(r);
printf("\n");
}

}
int get_size(void) // function to get size >0 <=8
{
int i;
do
{
i = get_int("Height: "); // ask for positive integer
}
while (i < 1 || i > 8); // between 1 and 8
return i;
}
void print_dots(int size) //function to print spaces
{
for (int x = 8; x > size; x--)
{
printf(" ");
}
}
void print_hash(int size) //function to print hashes
{

for (int y = 0; y < size; y++)
{
    printf("#");
}

}

:) mario.c exists
Log
checking that mario.c exists...
:) mario.c compiles
Log
running clang mario.c -o mario -std=c11 -ggdb -lm -lcs50...
:) rejects a height of -1
Log
running ./mario...
sending input -1...
checking that input was rejected...
:) rejects a height of 0
Log
running ./mario...
sending input 0...
checking that input was rejected...
:( handles a height of 1 correctly
Cause
expected ""# #"", not "" # # - here if I will remove spaces, it won't look as per instructions
Log
running ./mario...
sending input 1...

Expected Output: -same here

Actual Output:
# #
:( handles a height of 2 correctly
Cause
expected "" # #"\n"## ...", not "" # #"..." -same here
Log
running ./mario...
sending input 2...

Expected Output: -same here

Actual Output:
# #
## ##
:) handles a height of 8 correctly
Log
running ./mario...
sending input 8...
:( rejects a height of 9, and then accepts a height of 2 - what's wrong with this? It's meant to reject 9, and accept 2
Cause
expected "" # #"\n"## ...", not "" # #"..."
Log
running ./mario...
sending input 9...
checking that input was rejected...
sending input 2...

Expected Output:

Actual Output:
# #
## ##
:) rejects a non-numeric height of "foo"
Log
running ./mario...
sending input foo...
checking that input was rejected...
:) rejects a non-numeric height of ""
Log
running ./mario...
sending input ...
checking that input was rejected...

@rongxin-liu
Copy link
Contributor

Please do not post your code publicly. You might want to post assignment-related questions on Discord, Ed, or other platforms per: https://cs50.harvard.edu/x/2023/communities/

@rongxin-liu rongxin-liu closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2023
@cs50 cs50 locked as off-topic and limited conversation to collaborators Feb 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants