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
1answer
122 views

cs50.mario.pset1.having problems getting # on every line

Sorry for another annoying mario post. I have been working on this code for awhile and I am having some difficulties. I can get the right number of # and spaces on the last line, and the right ...
1
vote
1answer
146 views

What is wrong with my mario code?

When I run my code with make mario and ./mario, everything works fine with user input. I can enter any integer and I get the correct result. But when I enter check50, I get this result: :) mario.c ...
1
vote
1answer
49 views

Pset1 Mario incorrect output inside for loop

I try to create a simple output for definite height of the stairs and I create following code int spaces = 7; int sharps = 2; printf("%i\n", spaces); // debug printf("%i\n", sharps); // debug for ...
1
vote
1answer
299 views

pset1 mario pyramid help

My pyramid keeps coming out upside and incomplete. I am not sure what I did wrong but I think it is in my code for the #s. I replaced my spaces with S's to make sure they are there. Can someone help ...
1
vote
1answer
524 views

still needing help with mario

I have read and re-read through the help provided for mario here and other places, but am stuck at getting the right number of lines, but not the right characters in each line (i am substituting a for ...
1
vote
2answers
130 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
3answers
482 views

Help with pset1 mario, I don't understand what's wrong with my code

Whenever I do check50 on this code, it gives me lots of errors, and I'm not sure what I'm doing wrong.
1
vote
3answers
4k views

How do I fix error expected in for statement specifier when I use compiler

I have the code for the Mario pyramid written in chunks. The first part runs fine. I have arbitrarily assigned the height as 8 to compile the program. When I compile the pyramid, I am running ...
1
vote
2answers
111 views

Mario counter and output problem

I think I have a problem with the syntax of my main loop that counts the number of lines to output. When I set the counter = 1, it prints the correct number of rows but starts at the top with only 1 ...
1
vote
2answers
176 views

For loop not working

int nh, ns, h; // nh - number of hashes, ns - number of spaces, h - height for (h = 1; h <= n; h++) { for (ns = 23; ns < 23-h; ns--) { printf(" "); } for (nh = ...
1
vote
2answers
552 views

CS50: pset1 : mario - Errors (Need Help :) )

The following is my work for mario in pset1 and I do not understand the errors' meaning indicated in point 2. #include <cs50.h> #include <stdio.h> int main (void) { //Getting user's ...
1
vote
1answer
5k views

How to keep prompting the user when they enter an invalid number more than once

Ok, I've beat my head on the wall for over a week on this issue and I'm just over it at this point. Here's the code I have, I'll post the issue at the bottom of the code. As a side note, I am a first ...
1
vote
1answer
101 views

Using \t to make spaces in Mario

In pset1, while doing mario, I used \t for space but in output it shows more than one space. I tried to fix it by clicking on "edit" in gedit and reducing tab size to 1, then I resaved and recompiled ...
1
vote
2answers
447 views

I'm completely lost with mario

I did the first bit of the mario pset, but i have no idea where to start for the second part. ive watched the walkthroughs, but im still confused. even if i understand how many hashes and spaces there ...
1
vote
1answer
107 views

Why does my code return 0 if I input the correct integer after the retry?

// get height of pyramid from user printf("height: "); n = GetInt(); } // printing output for pyramid if (n > 0 && n <= 23) { for (int i = 0; i < n; i++) { /...
1
vote
1answer
756 views

Why Does mario Not Pass check50 Tests?

Having issues passing check50's tests for mario. I looked at other issues, including ones that look the same as mine, but I haven't found a solution. My code seems to give the desired results as ...
1
vote
1answer
837 views

Clueless on where to start for Mario (Less comfortable) in CS50 2019

I am currently in the process of finishing Problem Set 1 from CS50 2019, which involves creating a pyramid out of hashes. The pyramid must be made by the user inputting a number between 1 and 8 (...
1
vote
3answers
175 views

hacker1 edition of mario.c, alternative solution, check50 expected output for heigth 2 and 23

I started with mario.c from hacker1 problem set. I found a tricky and fast solution (when building up really high pyramids > 1000 rows) to build up the pyramids using printf's align functionallity ...
1
vote
1answer
128 views

Mario pset1 pyramid

I need help. can't seem to get the hashs to execute the way i want them to. Here is a sample of my code. #include <cs50.h> #include <stdio.h> int GetPositiveInt(void); int main(void) { ...
1
vote
1answer
161 views

CS50 pset1 - mario issues

this is for the pset1 problem and my issue is with height = 1 or height 2, can someone please help! #include <stdio.h> #include <cs50.h> int main(void) { int height, lines, spaces, ...
1
vote
2answers
75 views

Why can't this be left aligned?

why this code not left aligned? please help, english isn't my 1st language #include <stdio.h> #include <cs50.h> int main(void) { int h; do { printf("height: "); ...
1
vote
1answer
702 views

ItsaMario Pset1 pyramid left-aligned

Whenever I execute my code, I get a pyramid that is left-aligned instead of right-aligned. I think it is because my for loop for variable j is wrong and therefore none of the spaces will print. I ...
1
vote
1answer
198 views

How to ask for user input

I have recently completed Mario, however, I am unsure how to phrase the user input for "Height: ". Are we to assume that the user knows what they are to put in, in which case "Height: " is appropriate ...
1
vote
1answer
139 views

Mario.c errors for pset1

do { printf("Height: \n"); h = GetInt(); } while (h < 1 || h > 23); This is what I've done so far for mario.c and even though the output is similar to the requirements I'm still ...
1
vote
2answers
449 views

Mario outputs visibly correct, but some aspects fail check50 and gradebook

My mario.c output looks visibly correct, but some of the aspects are failing check50 and gradebook. For example, the height of 1 check shows message "\ expected output, but not "xx\n" Other data ...
1
vote
2answers
885 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 ...
1
vote
2answers
671 views

mario step 1 getting undeclared identifier error

I am trying to use the GetInt() function on my variable x and repeat the do while loop if the answer is not between 1-23 but I keep getting undeclared identifier error #include <stdio.h> #...
1
vote
2answers
3k views

Pset1: Mario.c Pyramid left aligned instead of right

My brain is completely stumped. I wrote this out on paper, and I discovered that as the hash tags increase, the spaces decrease going top to bottom. My problem is that the pyramid is left aligned, ...
1
vote
2answers
114 views

Error in Mario, what is wrong?

This is an excerpt of my code: printf{"%c, t"}; printf{"#"}; printf{"\n"}; But it has an error that says: mario.c:17:18: error: more '%' conversions than data arguements [-Werror, -Wformat] printf("...
0
votes
2answers
1k views

Tips on spaces and hashes Mario

So I've been on Mario for about a week now and I have the user input part and the rows right, and I just need someone to give me tips or how to get started on the spaces and hashes, and btw I really ...
0
votes
2answers
2k views

How to debug "initialized element is not a compile-time constant" and "expected identifier" errors

I'm trying to retrieve an input from the user and then apply it to the portion of mario.c that makes prints the pyramid. After several hours of trial and error, here is what I have been able to come ...
0
votes
2answers
135 views

Pset1: Problem: expected “##\n”, not “ ##\n”

Program works like a charm but still get these errors in the end when running the check. Could not figure out the issue. Why ? Thanks
0
votes
2answers
1k views

any idea how to fix Mario more comfortable problem "expected output"

when I executed i have this error :) mario.c exists :) mario.c compiles :) rejects a height of -1 :) handles a height of 0 correctly :) handles a height of 1 correctly *:( handles a height of 2 ...
0
votes
1answer
106 views

What's wrong with this code?

Well, I don't know what's the matter with this code (Mario). When I run it, the terminal goes crazy, like a thousands enters are triggered, the "craziness" of the terminal don't stop, I have to quit ...
0
votes
2answers
153 views

what exactly is wrong in my output? [duplicate]

Why does check50 keep returning errors ? My output is exactly, what's asked. What is it expecting? Moreover, what does it mean by exit code of 0? I have tried several times. check50 results Sandbox ...
0
votes
4answers
1k views

PSET1 Mario - nested loops for printing #s and spaces

So while approaching PSET1, my intent is to have a for loop that repeats itself as many times as the input height and then inside it two nested loops that will print #s and spaces. Problem is, these ...
0
votes
2answers
659 views

Pset1 : the mario question. I don't understand the logic of my own solution, it just doesn't make sense (found it by randomly playing around)

0 down vote I wonder if someone can clear something up for me. I have been working on this problem, and I have got a solution that works. ie, the numbes of spaces decline, and the number of hashes ...
0
votes
3answers
944 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
3answers
370 views

Output on Mario

I am not sure how to get the code working the way I want. I think it should make sense. Should I change my approach on the output section to do...while? int height, space, hash; do { ...
0
votes
3answers
686 views

Mario Pyramid - Check50 - Unexpected end of input

Does anyone know what this means? I'm getting the correct output from my program and this is the only message I get from check50.
0
votes
1answer
196 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
3answers
662 views

I am ABSOLUTELY STUCK! (mario less)

Ok, I have tried and have gotten a 60%. I need at least a 70% to pass. Please. Help. Me. Please. Tell. Me. What. Do. I. Do. I am done cash and now I'm stuck on this! Here is my code: #include <...
0
votes
1answer
1k views

Pset 1 - Mario pyramid trouble with spaces/dots

So I was able to set up the prompt and the left aligned pyramid correctly, but really started struggling when trying to right-align it with dots in front of the hashes. For whatever reason, its ...
0
votes
1answer
88 views

cs50 pset1 mario math wrong or order?

So I'm working on mario less and running into a road block. I got it to output the space and rows and columns but it's upside down, backwards and not the right number of spaces exactly. Like if you ...
0
votes
1answer
2k views

did not find EOF Pset 1 mario. expected "##\n", not " ##\n"

Program works like a charm but still get these errors in the end when running the check. :( handles a height of 0 correctly did not find EOF :( handles a height of 1 correctly expected "##\n",...
0
votes
1answer
64 views

Mario.c : having problems with SCOPE and iteration. Very new to coding

Here's one of my attempts at creating the mario.c problem set...it won't compile. Can anyone give me a hint as to where I'm going wrong? (prob more than one error) I wrote another one that didn't ...
0
votes
1answer
98 views

cs50 pset1 mario

I solved the assignment but I do not understand this part: for (hash = height - row -1 ; hash < height +1; hash++) from for (row = 0; row < height; row++) { for (space = height - ...
0
votes
2answers
167 views

redefinition of "variable_name" error when compiling - pset1 mario

When compiling, I'm struggling with this error, I know I don't have the logic for the pyramid yet but wanted to break the problem up into smaller steps. I can't see why this won't just do a simple ...
0
votes
2answers
101 views

How am I supposed to read these error messages?

jharvard@appliance (~/Dropbox/pset1): check50 2014.fall.pset1.mario mario.c :) mario.c exists :) mario.c compiles :) rejects a height of -1 :) handles a height of 0 correctly :( handles a height of ...
0
votes
2answers
723 views

bash: ./mario: Permission denied in Mario problem pset1

I think I wrote my code correctly. I used the same algorithm in Java and it gave me the perfect output. Can someone please tell me what's not working for this one and why it wont even comiple? mod: (...

1
2
3 4 5
10