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
0
votes
2answers
107 views

Stuck in pset1 mario.c

#include<stdio.h> #include<cs50.h> int main(void) { int n,r,a,s; do { printf("the pyramids height?\n"); n = get_int(); } while(n<=0||n>=23); for(r=...
0
votes
2answers
81 views

mario.c check 50 error

I get 2 blank lines when I run my mario.c program before it outputs the pyramid for some reason which causes it not to pass check50. Why? #include <stdio.h> #include <cs50.h> int ...
1
vote
2answers
73 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
2answers
84 views

Help With PSET 1 - Mario!(check)

I write my code and check it with staff version they are the same.but the check doesn't accept any answer
0
votes
1answer
134 views

Problem with printing the # symbols on mario.c

I'm working on the mario staircase right now and everything works so far except printing out the hash symbols correctly. That's the code I've written so far: int main(void) { // declare variable int ...
0
votes
1answer
114 views

pset1 Mario(More) unable to find the error in the code

Below code is my attempt to solve Mario(More). However i do receive error when i use check50 cs50/2017/x/mario/more .I have saved my file and compiled it again. Also submitted the file to cs50.me and ...
0
votes
1answer
78 views

PSET1: Output in Mario (more confortable) is correct but check50 says otherwise

#include <cs50.h> #include <stdio.h> void pyramid(int height); int main(void){ printf("Height: "); int height = get_int(); if (height < 0 || height > 23) { ...
0
votes
1answer
122 views

pset1 expected output mario

Problem at PSET1, Mario (More Comfortable) I have written to output the pyramid as per specs. While they give the correct output when running the program, check50 is giving two errors with input of 2 ...
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
175 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
181 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
97 views

Mario Problem Set #1 (Rows not Printing)

I'm having a bit of trouble with my for loops for the less comfortable version of Mario. I set up the outer for loop to keep track of which row is being printed and the inner for loops for printing ...
0
votes
1answer
55 views

Pset1 Question Mario

So I figured everything out except why when I configure the program it doesnt print anything. No hashes no spaces! #include <cs50.h> #include <stdio.h> int main(void) { ...
0
votes
2answers
40 views

Give a Function access to earlier value

If the main block of code gets a value from the user, assigns it to an integer, and then changes that interger's value, is there a way for a function (created outside the main block of code) to access ...
0
votes
2answers
159 views

pset 1 mario less. Trouble with checks

I am having some of my checks fail in pset1 mario less. Everything seems to work well when I check it by inputting the checks myself, and I cannot seem to figure out what isn't working. Any ...
0
votes
1answer
70 views

mario pset1 check50 has errors, but seems fine to me. No?

Guys, now the check50 is working, but shows me a few errors as you can see on the pic, on height number 1, 2, 23, and 24. And the output seems fine to me, as in according to the specs. (On the pics ...
0
votes
2answers
1k views

how to use check50 on mario pset1?

What's the correct ID to use check50 for mario on pset1 guys? I get "invalid ID" on every check50 ID I use. I thought "check50 2016.mario mario.c" was the one to check, but seems not. Any help? ...
0
votes
1answer
38 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
643 views

Problem with “expression result unused error” in for-loop?

I am getting an error message of "expression result unused" for the bottom two for loops (specifically h + 1 and s - 1). I've tried looking for through the other questions for an answer but nothing ...
0
votes
1answer
405 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
2answers
219 views

Can't properly check mario.c less comfortable, something wrong with spacing

I seem to be so close to the end of passing this assignment. My staircase seems to come out perfect, but when I go to check it with check50, I'm told that there appears to be something wrong with my ...
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
80 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
99 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
429 views

pset1 more comfortable mario seemingly correct output

int main(void) { int original_height, var_height; // original height and variable height int row_position; do { printf("height: "); original_height = GetInt(); /...
0
votes
2answers
47 views

Two Required Spaces Fail Check50 But One Space Passes

The spec requires that there are two spaces between the left section of hashes and the right section of hashes. As you'll see below, when using two spaces, it fails, however when I use one, it passes. ...
1
vote
1answer
5k views

pset1 mario - declaration shadows a local variable

I can't seem to figure out what I'm doing wrong here. I'm getting the following error for the code below. Any ideas?
0
votes
1answer
126 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
453 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
2answers
104 views

PSET1 MARIO - the pyramid doesn't appear when i execute the code

I am banging my head against my desk with this. I have written the code and it executes without any errors. However when i input the number to advise how high i want Mario to climb, the mouse cursor ...
1
vote
1answer
105 views

PSet1 While Loop to Print Spaces for Mario Not Working

I have approached this problem by using a forloop with two nested loops. The second nested loop works and prints the correct number of hashes. The first nested loops does not appear to working at all, ...
0
votes
2answers
180 views

Trying to reimplement GetInt()

I want to reimplement the GetInt() function from the CS50 library. I've mostly succeeded with the following code, but if I enter a single character, or CTRL+, I'm left with an extra newline so that I ...
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 ...
2
votes
1answer
95 views

Mario program will not proceed past the spaces

I am having trouble getting the pyramid to print anything more than the first row of spaces, and the number of spaces it prints is not correct; for example, for a height of 4, it prints 4 spaces, not ...
3
votes
3answers
12k views

MARIO LESS COMFORTABLE

I have been working at this pset for hours. within 5 minutes i got the hello.c and water.c assignments completed. But when it comes to mario.c, I am utterly lost. I have watched every video. I ...
0
votes
0answers
637 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
2answers
42 views

Have looked all over the web. Can't figure out: Error: expected identifier or '(' {

I've had this problem since the beginning. I got error messages saying it expected a semicolon after int main (void), and this one has been persistent. It tells me it expects an identifier '(' instead ...
0
votes
1answer
145 views

pset1 mario less pyramid prints backwards

My code prints the pyramid backwards. It uses the correct number of spaces before the pyramid but when it prints it is left aligned. Could someone let me know where the error in my code is? #include &...
0
votes
1answer
73 views

mario2 cs50 check error

I'm having some trouble with the error check. I tried to eliminate the extra spaces, increase number of line by one but still can't pass the error. Here is the loop: for (int i = 0; i < n + 1; i++)...
0
votes
1answer
578 views

My code for check50 on mario less comfortable is wrong can someone help?

Errors :) mario.c exists :) mario.c compiles :) rejects a height of -1 :( handles a height of 0 correctly \ expected an exit code of 0, not output of "Input a postive between 1 and 23\n" :( ...
0
votes
1answer
507 views

PSET 1 Mario calculating spaces

Having a little issue understanding this. in the mario code I'm looking at. // I understand this repeats the loop "pyramid_height" times. all good here. for(int i = 0; i < pyramid_height; i++) /...
0
votes
1answer
100 views

initialization; condition; update in mario.c less comfortable

I am really having a problem with developing the "initialization; condition; update" part of my for loop in my mario (less comfortable) code could anyone help me with understanding what to input
0
votes
1answer
53 views

PSET1 mario.c why if and return

I was banging my head with this. I had to look at others solutions to get my code to work. Here is the code I have, it works now but only because I looked at solution. I had this code written minus ...
-1
votes
1answer
1k views

pset1 mario less code problem

I have a problem with my code about mario.c... I was trying the whole evening as I am a newbie Here is my screenshot. Thanks in advance . #include <cs50.h> #include <stdio.h> int main(...
0
votes
1answer
999 views

cs50 mario :( handles a height of 23 correctly \ expected output, but not “ # #\n …”

I'm an absolute beginner. Sorry for the long code. It seems to be returning the desired result, i.e. print correct shape and reject number that is our of range. But what's the problem of my code? ...
0
votes
1answer
78 views

Mario outputs seem correct nut the check50 won't accept it [duplicate]

Testing the code manually, the output seems ok. But then when I use check50 it fails with the inputs 2 and 23. #include <stdio.h> #include <cs50.h> int main(void) { printf("Type the ...
0
votes
2answers
57 views

while loop gets executed even though conditions inside are not met

while(height >= 23 || height < 0) { printf("Retry: "); height = get_int(); } now if hieght is greater than 23 or less than 0 then only code inside should be executed ...
0
votes
1answer
239 views

pset6 mario - get_int doesn't work like it says in the notes

I'm stuck again! I've tried to port mario into python but I'm totally stuck on the first line! I'm trying to use 'cs50.get_int()' as shown but my programme doesn't prompt for the number, then if I ...
0
votes
2answers
608 views

(CS50 mario.less)Please point out the mistake in my code.(pset 1)

I need your assistance with my code foe CS50 problem set 1, the mario(less comfortable). I seem to have a few problems with the logic inside my code. Would you mind pointing out the mistakes? I would ...
0
votes
1answer
207 views

Mario.c repeatedly asks for height but does not print

The following is my code for PSET1 Mario.c where the expected outcome is the user is prompted for a height number between 1-23, and based on that number, it builds a half pyramid with the "#" symbol. ...

1 2 3
4
5
10