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
5
votes
4answers
2k views

Completely lost.. pset1, Mario help

I am completely stuck. I'm not quite sure why I don't understand how to do this. I don't understand the hash tag and spaces thing. I have read so many explanations of it on this website, but none of ...
4
votes
2answers
67k 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?...
3
votes
2answers
16k views

Problem with "expression result unused" error in for-loop

There is obviously something missing in my understanding of the for-loop. Part of my code looks like this: int height; do { printf("Height?: "); height = GetInt(); } while (height < 0 || ...
3
votes
2answers
165 views

Which loop can be replaced for nested for loops for PSET 1 (Mario More Comfortable)?

According to the cs50 style guide for C, more than 3 variables for iteration is not a good practice. I have done Pset 1 (Mario more comfortable) with 5 for loops, so it has 5 iterations variables. Is ...
3
votes
1answer
1k views

Infinite loop when validating input as integer

I am having problems with the error handling portion of the mario assignment. When I try to check if the input is a non-integer my program gets stuck on an infinite loop. Also, how should we check if ...
3
votes
1answer
32k views

C syntax errors like "expected expression"

I completed an introduction to programming using Python and I am more used to Python then C, so I might mix the two up. C is giving me all kinds of errors. I tried changing things but noting seems to ...
3
votes
3answers
3k views

Stuck on PSet1: I have the correct output, but Check50 says it's wrong

I'm stuck on the Mario part of PSet1. I've managed to write up my program and the output is always correct (or at least seems to be to me). I know it's definitely the loops that are making things ...
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 ...
2
votes
3answers
3k views

How to approach Problem Set 1 Mario!

I'm really struggling with the First Problem Set 1 'Mario. Can somebody please just give me a hint as to where to start or where I can do more research? (Just Purchased Absolute Beginners Guide to C ...
2
votes
1answer
9k views

Stuck on pyramid for mario.c

I have the first part of mario.c done. The computer asks the user for input and then continues to ask if the user does not input an acceptable number. However I am unsure of how to print the #'s and ...
2
votes
2answers
2k views

Do do/while loops only take one line?

Whenever I put in more than one line in the do/while loop, I get this error. mario.c:9:7: error: expected 'while' in do/while loop printf("Nope, again please,\n"); ^ mario.c:7:5: note: to match ...
2
votes
2answers
233 views

How to Convert Integers to Spaces/Hashes?

I am stuck at converting the integer input I get from the user into spaces/hashes. How to use this integer with my printf() function to print spaces/hashes?
2
votes
1answer
233 views

Why is my `mario` pyramid height restriction not working?

Can someone help me with problem set 1? I got the pyramid working, but my height restrictions seems to not work. When I type in letters and negative numbers for height, the program does not print out ...
2
votes
2answers
2k views

PSET1:: Mario More Comfortable :: confused about check50 output

I am sorry if I miss something obvious here, but I am an absolute beginner. I get the following output from check50, which I am confused about: I will attach my code below, but my output for 2 is: ...
2
votes
1answer
271 views

My code seems to be working but check50 is giving me this "\ expected output, but not "#\n""

My code seems to be working but I keep failing on check50. As an example, I get this back from check 50: :( handles a height of 1 correctly \ expected output, but not "#\n" :( handles a height of ...
2
votes
1answer
265 views

pset6 mario/more fails one check50 test despite getting correct output

My code passes all tests of check50 running check50 cs50/2018/x/sentimental/mario/more except this one: rejects a height of 24, and then accepts a height of 2 expected " # #\n## ##\n", not "" ...
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 ...
1
vote
5answers
8k views

What's wrong with my code for mario?

I've been stuck on pset1 for five months now. I like to do things chronologically and mario has been giving me headaches. Every time I think I have the problem solved, I'm told it's wrong or a lot is ...
1
vote
2answers
123 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 ...
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?
1
vote
2answers
104 views

PSET1 Mario More: Same output but still displays error

#include <stdio.h> #include <cs50.h> int main(void) { int block; do { printf("Height: "); block = get_int(); } while (block < 0 || block > 23); ...
1
vote
2answers
89 views

pset1: mario - error msg

Newbie here. Apparently missing something here I can't even decipher the error message. Please let me know what went wrong! Thank you! int main(void) { int height; do { printf("...
1
vote
2answers
231 views

Approaching pset1?

I'm a 16 year old student trying to grasp the concepts of C in Week 2 of the course and I'm definitely struggling quite a bit - I'm at a loss for where to start with my Mario project. To help myself, ...
1
vote
1answer
39k views

Why do I get an "undefined identifier" error even though the variable is defined in my code?

I've been trying to get the Mario problem finished. What appears to me to be a workable solution keeps generating error messages (when I run the compiler) around an "undeclared identifier" (even ...
1
vote
3answers
74 views

PSET 1 Can't implement loop at the prompt

I'm still on my prompt part, couldn't get to the pyramid yet, my code compiles but I can't make the loop recursive, that is, after the first entry it goes back to the prompt $. Here is the code: #...
1
vote
3answers
71 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 ...
1
vote
1answer
757 views

Doing mario.c less comfortable one step at a time

Like many others here I am completely new to coding. No experience whatsoever. I have been busy with the less comfortable Mario.c for a while now, trying to understand what is going on every step of ...
1
vote
1answer
61 views

tests give weird results despite (seemingly) correct output

I receive the test feedback expected "# #\n", not " # # \n" for the test running with n = 1, with the following code snippet called to for printing: for i in range(n): print( (n - i) * '...
1
vote
2answers
413 views

hacker1 mario runs properly but fails check50

As you can see the code runs fine and gives the expected output of double pyramid for the numbers entered between 0 and 23 but check 50 says i have an error can someone enlighten me about what i have ...
1
vote
1answer
154 views

fatal error: 'stio.h' file not found (pset1) [closed]

After successfully executing the 'hello.c' program, I'm unable to execute 'mario.c' because terminal says 'stio.h' file not found (which IMO doesn't make any sense since 'hello.c' runs perfectly). Any ...
1
vote
1answer
1k views

pset1 mario less comfortable

Can someone lend me some advice? I'm having trouble with finding the logic between the space and hashes. int main(void) { int height, row, hash; do { printf("Height: "); ...
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, ...
1
vote
2answers
835 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 ...
1
vote
2answers
174 views

How can I improve my code for pset1 mario?

This is my code for pset1 mario problem. It works but it looks really messy and inefficient. I think I could use less variables and use the while loops better but I'm not sure where to begin. I'd be ...
1
vote
2answers
176 views

pset1 mario need tip

been stuck on this for a couple days, i think i've gotten the spaces concept down, but what am i doing wrong with the #? i know the first row needs 2 #s, so would my for loop begin with hashes=2 ? ...
1
vote
2answers
278 views

pset 1 mario \ expected an exit code of 0, not output of "Height: "

My output is fine however check50 says: :( handles a height of 0 correctly \ expected an exit code of 0, not output of "Height: "
1
vote
1answer
168 views

PS1 Mario, prints out nicely but check 50 rejects

I've got this code for the Mario assignement in pset1. It prints out OK in the shell, but check50 rejects it. Can anybody help me? #include <stdio.h> #include <cs50.h> int main(void) { ...
1
vote
1answer
69 views

Using (0 <= Height < 8) together with a while loop

I tried to use while (0 <= Height < 8) in my program but it didn't work. My program just keeps looping no matter what value I enter. But it works when I use a Boolean expression in it. Like so ...
1
vote
1answer
247 views

Correct spacing but hashes won't print correctly in mario

I am working on Mario and have written the following code. The problem I have is that I have the correct spacing but my hashes wont print correctly. Just to be clear I think I know why it isnt ...
1
vote
2answers
912 views

How to Handle the Height of 0 Correctly?

I've completed the mario program and it works fine! When I re-checked the pset specification page, I found that I should accept non-negative integer no greater than 23. So I edited my code to ...
1
vote
1answer
95 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
1answer
170 views

CS50 mario pset 1 error: expected '(' after 'do/while'

Here is my code: #include <cs50.h> #include <stdio.h> int main(void) { int n; do { printf("height: "); n = get_int(" "); } while { (n < ...
1
vote
2answers
103 views

I don't know why check50 HATES ME?! mario.more

Here's my code for mario.more. [removed solution code] When i execute this code, it performs exactly how it should look according to Walkthrough: But when I run check50, the terminal goes like ...
1
vote
1answer
64 views

CS50 Pset 1 mario soluce

I have sent my code for the pset of mario, he is working but i have only 55% and i dont know why ! I have search the soluce on the web to compare but didnt found ! Can someone look on my program to ...
1
vote
1answer
437 views

Prompt for integer > 2 and < 8 in C

Really rookie question about C... I want the user to enter a number between 2 and 8, and if they don't, the prompt repeats itself until an integer within my parameters is entered. I can get this to ...
1
vote
2answers
57 views

Cs50 pset1 mario syntax errors or wrong code

Okay so I've tried multiple ways to get my blocks to simply create columns and rows first before adding spaces (though I've tried). I've watched and rewatched the lecture multiple times but I can't ...
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, ...
1
vote
1answer
242 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
1answer
130 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 ...

1
2 3 4 5
10