Questions tagged [mario]

mario.c, one of the assignments for Problem Set 1, asks you to develop an algorithm to draw an ASCII art staircase similar to those seen in the classic Nintendo game.

Filter by
Sorted by
Tagged with
1
vote
2answers
872 views

pset1 mario: please help with my code

The below is what I have come up so far and the result is very underwhelming. It just doesn't work out as I expected. The first part works well but I am struggling with the second one. Any help would ...
0
votes
2answers
27 views

mario more comfortable; “can't check until a frown turns upside down”

[EDIT: Code removed for Honor Code compliance.] The code seems to be running perfectly fine and gives the correct output But every time i try to check it, i get this: :) mario.c exists :( mario.c ...
0
votes
1answer
157 views

I can get the correct height for my pyramid but I can't get the spaces or #s to add or subtract properly in my loop

{ for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { printf("%d\n", j); } for (int k = n; k < n + 2; k++) { printf("#"); } printf(" \n"); return (0); }
0
votes
3answers
38 views

PSET6 Mario Python

I have been experiementing with this code for a couple hours and have come across an issue with each implementation. I can no longer put in any time at the moment so I figured I would go ahead and ask....
0
votes
1answer
112 views

Pset 1 Less comfortable - Number of Hashes

Sorry for the beginners's question. When I try to compile to following code for the Mario - Less Comfortable problem, I am printing the same number of hashes for each row and am unsure why. Code is ...
0
votes
2answers
62 views

mario less comfortable help

I wrote this code for the mario problem but idk if it's right. i'm having trouble running it. It keeps saying error: linker command failed with exit code. #include <cs50.h> #include <stdio.h&...
0
votes
1answer
90 views

pset1 less comfortable mario

Somebody please help me I have watched the walkthrough thrice, many different videos and searched for answers on reddit and stackexchange yet i've been stuck at this for hours now and cant get through....
1
vote
1answer
58 views

PSET1 Mario pyramid - Can someone explain me the logic of this line of code?

I was able to make the Mario's pyramid from Problem Set 1, (I know it should be right alligned, not left). This is the code, and it is working fine when I execute the program, but I don't seem to ...
0
votes
2answers
50 views

When printing mario problem the second triangle appears below the first one

#include <stdio.h> #include <cs50.h> int main(void) { //This do while loop checks if user entered number 1-8 int x; do { x = get_int("Height: "); } while ...
1
vote
2answers
76 views

pset1 (mario, more) - problem with unwanted leading spaces

This is what check50 gives me: > :( handles a height of 1 correctly > expected ""# #"", not "" "\n"# #"" > :( handles a ...
0
votes
1answer
27 views

Error Code - Use of undeclared identifier in PSET 1, Mario

An error code popped up while trying to compile my code, saying that the variable n had not been declared earlier. It had been declared however at the beginning. Here is the code and the terminal ...
0
votes
1answer
23 views

Query related to Mario program(more) in CS50 pset1

I can't figure out the problem in my code, it successfully creates a pyramid but doesn't reprompt when value other than 1-8 is entered, also it gives a space before printing the pyramid, causing ...
0
votes
1answer
466 views

I keep getting error: use of undeclared identifier 'n' when trying to compile mario.c. I am new to coding, my code is shown below

#include <cs50.h> #include <stdio.h> int get_positive_int(string prompt); int main(void) { { int i=get_positive_int("Height:"); } for (int i = 1; i < n; i++) ...
0
votes
3answers
926 views

Check50 tests fail with expected output, but not “ ##\n”

I completed pset1 recently and I've been wondering about my mario code. My program runs fine and (looks like) it does exactly what it's supposed to. When I use check50 on the code I get the following:...
0
votes
2answers
247 views

pset1 Mario trouble

I've been working on this for days now, and have reached a point where I'm afriad I've gone further away from the LOGIC of the problem. At the moment, the complier doesn't print out line 16 and yet ...
0
votes
1answer
173 views

Stuck at pset 1 mario problem

I'm Stuck at the PSET 1 problem of CS50. for height 3, my output is coming as ..# ..## ..### Can any peers or experts, look into my code and help me out. [EDIT: code removed for Honor Code ...
0
votes
1answer
53 views

Unable to compile pset1. Mario (Less comfortable)

I am unable to compile my file and get many errors. INPUT #include <cs50.h> #include <stdio.h> int main(void) //Prompt for the height of the pyramid int height; height = get_int (...
0
votes
1answer
33 views

My 'pset1 Mario more comfortable' is returning check50 errors whilst seemingly correct

I saw this question has been asked in multiple ways before but I believe I've checked answers and am still stumped as to the issue I have. The output for my pset1 Mario more comfortable appears to be ...
0
votes
1answer
53 views

PSET 1 Less comfortable Mario

I have been writing this code for a day but I still could not get the result I want, I don't even know how the is giving me a weird result. Here's my code: #include <cs50.h> #include <stdio....
0
votes
1answer
69 views

pset6 mario/more - output is seemingly correct, however failing tests

I've just finished mario/more in pset6, however, it does not pass the tests. The actual and expected outputs are identical, so is the expected string. The pyramid also looks identical to the c ...
1
vote
3answers
51 views

mario pset 1 starter issue

hey im having problems getting started with the mario pset. my code is below and i am getting these errors... any help would be so much appreciated thanks. mario.c:16:5: error: expected expression ...
0
votes
1answer
24 views

Errors on Mario pyramid

I thought had solved the Mario Pyramid problem until I got back all these errors :( handles a height of 1 correctly Cause expected ""# #"", not "" # # ..." :( handles a height of 2 ...
0
votes
1answer
14 views

No rule to make target 'mario'. Stuck on where I am going wrong. Cannot compile existing file

I have viewed similiar question/answers on this site and still cannot troubleshoot where I am going wrong. The mario.c file exists in the mario folder. It just will not compile from what I can tell. ...
0
votes
2answers
68 views

mario.c (comrfortable) error code

I ran the test and it was an error #include <cs50.h> #include <stdio.h> int Height; int space; int hash; int rows; int main(void) { do { printf("Welcome to Mario, ...
0
votes
1answer
13 views

error: expected identifier or '(' I thought I had solved this

#include <cs50.h> #include <stdio.h> #include <math.h> int n; { do { n = get_int("Height: "); } while (n < 1 && n < 8); for (int i = 0; i < 8; i++) { ...
0
votes
2answers
50 views

Do - While loop

I am trying to do the Mario problem with C. The issue is that I want the user to select a number from 1 to 8. So my boolean expression is (n < 9 && n > 0). But I don't know why is not ...
0
votes
1answer
104 views

MARIO!! just look over

what in the world is wrong with my code: #include <stdio.h> #include <cs50.h> int main(void) { int n; do { // prompt user for a number 0 to 23 n = get_int(); printf ...
0
votes
1answer
112 views

Finished Mario week 1, but unsure if it's a proper solution

So I managed to get the intended result for Week 1 problem set 1 Mario (less comfortable), but I'm not sure if my solution would be considered good code. In line 11, is it ok to have subtracted by 1? ...
0
votes
3answers
516 views

check50 is getting a different result from me on mario

I have tested every criterion of Mario, and they all are met, but check50 is getting a different output than me. Here is a transcript of what happened. elephant1123@ide50:~/workspace/pset1 $ ./mario ...
3
votes
2answers
50k views

Error: “make: *** No rule to make target `mario'. Stop.”

I keep receiving and the error message " *** no rule to make target 'mario' stop" when I try to make mario. Does anyone have any advice? I already typed in pwd and I'm in the Jharvard desktop. Any one?...
0
votes
4answers
594 views

mario.c; error message: expected identifier

I have been trying for more than a week to correct compiling error: mario.c:19:1: error: expected identifier or '(' The response I received did not help. #include <cs50.h> #include <stdio....
0
votes
1answer
42 views

CS50 Terminal saying there's error in code that isn't there - More Comfortable Mario

Whenever I type Make Mario into the Terminal for the "More Comfortable" Mario.c assignment in Week 1, it keeps telling me I have an error on 13:9 - but there's nothing typed on 13:9. I'm a bit ...
0
votes
1answer
29 views
0
votes
1answer
42 views

Help please with code Mario error

#include <stdio.h> #include <cs50.h> int main(void) { int pyramid_height = 0; do { printf("Height:"); pyramid_height = GetInt(); if (pyramid_height == 1)...
0
votes
2answers
47 views

Pset1 Program does not stop printing dots dots/spaces for the pyramid and I don't understand why

After a certain number of iterations through the loops (lines 16 to 21), I expect the program to stop printing out dots since the "dotcount" should be equals to 0. However, an unnecessary dot is still ...
0
votes
0answers
25 views

it works in cs50 sandbox but when i use terminal to compile it doesnt

i followed the code about mario thing i used make mario / gcc -g mario.c -o mario -lcs50 -lm when i use make mario1.c:9:7: warning: implicit declaration of function 'get_int' is invalid in ...
0
votes
0answers
23 views

i use terminal to run mario stuff in my mac

i downloaded cs50 header file and tried <> , "" both but Undefined symbols for architecture x86_64: "_get_int", referenced from: _main in mario-af47a4.o ld: symbol(s) not found for ...
0
votes
1answer
34 views

Valid output decreed as invalid by check50?

I am having trouble with check50 in pset1 more mario. Below as follows is my code, it works. Yet, for some reason it is invalid. I know it is wrong to post my entire code but I am stumped. #include &...
0
votes
1answer
59 views

Failed to write to 'mario.c'. Failed to retrieve resource from vfs-gce-usw-289-4.c9.io

I ran Mario and one of the loops repeated forever. I exited the terminal and now I can't compile. I get this error message: Failed to write to 'mario.c'. Failed to retrieve resource from vfs-gce-usw-...
0
votes
1answer
72 views

Mario printing out backwards

Hello I am new to coding in c and not very familiar with it. I am getting the hash tags and I am using a - so I can see my spacing. Right now I am printing my pyramid the wrong way any help will be ...
0
votes
3answers
81 views

pset1 Mario more comfortable check50

I know this question has been asked several times but I haven't found an answer that worked for the issue I have. The output for my pset1 Mario more comfortable seems to be correct (including no extra ...
0
votes
1answer
56 views

I almost finished but my problem is with the side of the half-pyramid of mario

I finally reached the key for making this project but my problem is with the side of the pyramid i want it to be left sided instead. #include <cs50.h> #include <stdio.h> int main(void) ...
0
votes
1answer
49 views

pset1: Printing too many hashes

for the past few weeks I've been struggeling with making the half-piramid in pset1. I managed to come up with this code that prints the height of the piramid according to the user input, but after ...
0
votes
2answers
456 views

pset1 Mario. Spaces work, hashes don't and i can't see why

So I have been working on CS50's pset 1, making marios half pyramid. I have been looking over other problems on this site and I've gotten this far. But I can't seem to see what the problem is with my ...
0
votes
1answer
52 views

cs50 problem set 1 mario. check50 command returns error: 'You seem to be missing these required files: mario.c'

I have an error with commands check50 cs50/problems/2020/x/mario/less and submit50 cs50/problems/2020/x/mario/less its returns: ~/ $ check50 cs50/problems/2020/x/mario/less Connecting..... You ...
0
votes
1answer
44 views

Mario Less Loops doubt and code review

I have attempted the PSET 1 of 2020 CS50x and have a couple of doubts. Could someone check if the following code for Mario less one is correct. If it is I also had a question that what should I put ...
0
votes
2answers
265 views

Stuck on Mario Pset1

I'm stuck on Mario Pset1. I keep receiving line breaks, and the function seems to skip the nested for loops. #include <stdio.h> #include <cs50.h> int check(int b); int checktwo(int b); ...
0
votes
1answer
57 views

pset 6 mario, I'm getting wrong ouput

I'm getting an extra new line just after getting input. Help me fix it while True: n = cs50.get_int("Height: ") if n > 0 and n < 9: break for i in range(n + 1): if n == 0: ...
0
votes
1answer
103 views

pset1/mario.c compiling erros

I have tried solving the issues and looking for answers everywhere but mario doesn't compile. When I try to make mario, it shows me the error message below. I removed the ; in line 24 after such ...
0
votes
1answer
188 views

Still needing help with Mario pyramid construction

I can't figure out how to make the pyramid work. My current code from the //create pyramid onward is: //create pyramid for (int k = n; k+1<n; k++) printf("%d", k); printf("#"); ...

1
2 3 4 5
10