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.

76 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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 ...
1
vote
2answers
106 views

Weird problem - gedit isn't saving changes to my mario code

I've restarted it several times, saved the code under another name and done everything I can think of but it isn't using the changes I've made. For example, I used dots to make the pyramid so I could ...
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
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
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
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 ...
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....
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
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
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
0answers
28 views

Week 1 Super Mario Level 2

All, I have Mario built if I input numbers 1-8. However I can't get it to run a second time or re-run if I put in a number like 9. I think I need to have a loop to return it to the top. Have tried ...
0
votes
1answer
36 views

Prompt a user for a number. My code has an endless loop

i am trying to build a code in which the user should input a number between 1-5. In any other case the program should request the user to input a new number. My problem is that the program is going ...
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
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
0answers
92 views

Pset1 mario only executing do-while loop

So i've spent way too much time on this. Didnt expect it to be so difficult. I think i got the coding right but for some reason the program is only executing till the do-while loop and then it exits ...
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
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
1answer
52 views

pset1 mario uncomf - Hash's start in wrong place

I've ran into what appears to be a problem. I initially thought I finished this pset but when I was checking my work I noticed the #'s always started from the 8th character along the line? Even if I ...
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
0answers
49 views

Mario.py works but gets different check50 results each time without changing a thing in the source code

Can someone please point out what's wrong with my code? from cs50 import get_int def main(): print("Height should be a positive integer between 0 and 23.") # a "do-while" loop to recieve a ...
0
votes
2answers
126 views

Why isn't my block on pset1 turning into a staircase?

I am currently working on pset1 Mario, less comfortable. I am running my c to turn the hashtags into a staircase, but when I run the code, it is only a block. What is wrong with my code? Thank you all ...
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
0answers
66 views

Can't understand why i can't pass check50 for mario less

I'm totally confused, I tried every solution I could find, but still, I can't pass the check50. I keep getting the expected "##\n", not "#\n" error. i really need your help. here's my code: [removed ...
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
29 views

When I enter input that is integer more than 23, the program stops. I think it is supposed continue prompting in this case. What's wrong?

#include <stdio.h> #include <cs50.h> int main(void) { int n; do { n = get_int("Height: "); } while (n<=0 || n>23); }
0
votes
0answers
795 views

Extra Space Printing in CS50 Pset6 Mario Less - Python Version

Looks like similar questions were asked but I'm having problems with the Python version. Output looks fine on the surface but apparently the program is printing an extra spaces. I have played with the ...
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
0answers
60 views

2017 mario.c trailing whitespace for height < 23

I have been trying to fix the whitespace error generated with my code: int main() { int height; do { printf("Height: "); height = get_int(); } while (height < 0 || ...
0
votes
1answer
1k views

Mario Less Comfortable, do-while loop problem

Hi everyone I made sure to do my research and go through the already posted questions. I am certain my while condition is wrong after research but don't understand the correction. my program runs but ...
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
166 views

pset1 mario compiles and works, but cs50 shows error in compiling

My mario.c compiled and worked fine. But when I try to check it with cs50 check, it gives me these errors: :) mario.c exists :( mario.c compiles \ expected an exit code of 0, not standard error of "...
0
votes
1answer
148 views

pset6 how do we check for string in mario

I've tried to find out how to check for string input for mario.py. I know to check for the range of integers when getting input from the user, but if they enter a string instead of a number, is there ...
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
388 views

pset1 Mario Help?

So I understand the bases of the project, what I'm suppose to do etc, but when I prompt the user I get a bug, it also loops forever when I enter a negative integer is that normal? The do and while ...
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
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
1answer
95 views

Confused.Pset 1 mario half pyramid

I am really confused with mario half pyramid in pset1. I only need some help just give me a hint if I going right till now and what can I do for the # #include <cs50.h> #include <stdio....
0
votes
1answer
120 views

CS50 Mario spaces and hashes

I am new to programming and sincerely appreciate any help. I am having difficulties getting the number of hashes and spaces working correctly. Below is my code. Thanks in advance for support. int ...
0
votes
1answer
400 views

for loop mario.c

This is what I have for Mario.c less comfortable. I am having a problem printing the pyramid. Am I suppose to have a for loop for every space, #, and newline. for everyline. #=1 #
0
votes
0answers
625 views

How to approach Pset1 Mario problem?

So far I am able to get input from user and print the amount of rows using a loop, but after that i am stuck. after this, i just don't know how to approach adding an extra # starting on row 2 and ...
0
votes
1answer
76 views

Understanding for loops and lingering questions I need answered before moving on!

I coded this and it passes. I just want to understand it much better than I do at this moment. I got hung up on a few of things and found the solutions online to those questions I was having but I ...
0
votes
1answer
226 views

Problem in the do..while loop in Mario.c

before you block my answer for duplicates, I've spent over a day on this small bug. I've searched reddit, youtube and the stack exchange forums and still can't get it to work. I'm hopeless at this ...
0
votes
1answer
84 views

I get the right pyramid, but the check function keeps telling me otherwise!

#include <cs50.h> #include<stdio.h> int main(void) { int height, row, hash, space; do { printf("Height: "); height = get_int(); } while(height < 0 |...
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
0answers
76 views

Can someone tell me what is wrong with my code?

Can some one tell me what is wrong with this code?this code is giving me error in the cs50ide. #include<stdio.h> #include<cs50.h> int main(void) { int i,height,n=1; do { ...
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 ...
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
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("#"); ...