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
1answer
68 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
973 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
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
536 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
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
2answers
215 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
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
427 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
46 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
4k 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
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
2answers
102 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
136 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
92 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
11k 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
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
2answers
40 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
137 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
502 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
456 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
99 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
844 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
75 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
56 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
171 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
601 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
185 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. ...
0
votes
1answer
505 views

Can't break out of while loop in python

def main(): x = 0 while x not in range (1,23): getheight() if x in range (1,23): break for i in range (x): for j in range (x - j): print (" "...
0
votes
1answer
37 views

Need Help writing code in loops

the loops got me confused and i need some help so far this is what i've done http://i.imgur.com/9hmUBsw.png
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 ...
1
vote
1answer
146 views

Built mario's pyramid but can't get pass the check50

I've been struggling for days trying to get my mario pyramids to pass the check but I can't seem to get it to work. // I will be declaring my variables here int Height; int space; int dash; // I'm ...
1
vote
2answers
831 views

Pset1(mario.less)- What is the logic behind my approach?

This has been a bit, -a brain-teasing challenge for me for maybe two days-, and actually still is. After trying several times to solve this "logically" or "systematically" and unfortunately failing ...
0
votes
2answers
180 views

check50 error in pset1 with do while loop

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

Falling to put hashes in every line in mario.c

I manage to put the base of the pyramid and the rows needed, but I fail to put hashes before the base. #include <cs50.h> int main(void) { printf("Height: "); int Height; do { ...
0
votes
1answer
1k views

CS50 2017 Problem Set 6 Mario.py For loop

What is wrong with my second For Loop (spaces)? It seems like it only runs one time, according to the first line of the pyramid. import cs50 while True: print("Type a number between 0 and 23: ", ...
0
votes
1answer
133 views

Codestyling and whitespaces are important in Python? PSET6 [duplicate]

codestyling and whitespaces are important in Python? I have this simple code and works... import cs50 while True: print ("Type a number between 0 and 23: ", end="") n = cs50.get_int() ...
0
votes
1answer
1k views

CS50 2017 ProblemSet6 Mario.py

What is the problem with this simple code? I'm new with Python Also I know Python doesn’t have a do while loop, so instead I use while True, but break, or stop the loop, if n < 0 or n > 23: ...
1
vote
1answer
122 views

Need a video on nested for loops or written explaination?

I watched the video below and am curious how to I do nested for loops that contain more than 2 for loops ? I don't understand how to reverse the pyramid does anyone know? By reverse I mean 5 hashes ...
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
212 views

I keep getting mario.c:23:9: error: expected '(' after 'for' {

Ive looked everywhere and cant figure out why I keep getting this. I have my curly braces on right I believe and when i put (this code here) after the for loop everybody said it was wrong so Im not ...
0
votes
2answers
124 views

mario less complicated stuck in loop

I have been researching and watching the videos many times and I have spent 3 hours on this code and I have not figured much out. Right now I have the code printing # as only one character in an ...

1 2 3
4
5
10