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
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
213 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 ...
0
votes
3answers
258 views

How to apply my formula in pset1 mario.c for draw?

#include <cs50.h> #include <stdio.h> /*I know that for the number of rows for ( ; i < h; ) can help, I think spaces work like (h-1) or (h--); and hashes (i + 1)*/ int main(void) { ...
0
votes
3answers
175 views

pset1 not printing hashes for mario

#include <stdio.h> #include <cs50.h> int main(void) { int height; do { printf("Please give an integer that is less than 23 and greater than 0: \n"); rows = GetInt(); printf("Height:%i\...
-1
votes
1answer
89 views

Please help! I made the condition, but I don't know how to make the half-pyramid [closed]

#include <stdio.h> #include <cs50.h> #include <math.h> int main(void) { int pyramid_height = 0; while (0 >= pyramid_height || pyramid_height >= 24) { ...
0
votes
2answers
368 views

PSET 1 Hacker Mario [duplicate]

The instructions are here: http://cdn.cs50.net/2016/x/psets/1/hacker1/hacker1.html#itsa_mario and here for the full understanding of the basic requirements: http://cdn.cs50.net/2016/x/psets/1/pset1/...
0
votes
1answer
47 views

pset1 int ascii # to char # or just char # variable? the better way?

I have found two ways to define # in my code and would like to know the best practices way. Here is the code: int pound = 35 ; char p = pound; int space = 32 ; char s = space; char x ...
0
votes
2answers
563 views

Mario: Won't Compile

Here is my code so far: #include <stdio.h> #include <cs50.h> int main(void) { int x; #include <stdio.h> #include <cs50.h> int main(void) { int x; ...
0
votes
1answer
129 views

pset 1 mario - where am I going wrong

so I thought I had finally completed Pset1 and went back to mario to do the check50, and well it doesn't seem to like my code, and I can't see where I am going wrong, another pair of eyes would be ...
1
vote
1answer
114 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
145 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
2answers
172 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 ...
0
votes
2answers
223 views

pset1 mario output

im trying to print the pyramid but its not printing as expected i dont understand what went wrong the program works well when i compile and run it how do i fix it? this is my cs50chech result :) ...
0
votes
1answer
102 views

I'm trying to simplify the mario exercise and I can't compile my program

I'm trying to simplify the mario exercise by making my code print the number of hashtags the user inputs for the height without the spaces. Like this: height 4: # # # # #include <stdio.h> #...
1
vote
2answers
174 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 ? ...
0
votes
2answers
130 views

CS50 Pset1 Mario fails test

I am having issues with the mario Pset. I end up with almost the desired results but A.) the check says its not performing properly and B.) It seems to add 1 less # then needed. but if i try to ...
-1
votes
1answer
217 views

Problem Set 1 - mario.c (Help)

So after scratching my head for a long time I figured out the algorithm to approach the "Itsa Mario" program. This is the code I wrote and I am horribly stuck. The compiler gives errors when I try to ...
0
votes
2answers
266 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
2answers
268 views

I'm sorry for another Mario question, but I'm stuck on the second half and have read the questions asking for help

This is as far as I've gotten with Itsa Mario. I've got the first part of the problem down just fine, but I'm extremely tripped up by the second part. I'm very curious because I know that the spaces ...
0
votes
2answers
119 views

Mario problems. how to fix an undeclared variable

![mario code]http://imgur.com/mlm5QJc I am having trouble figuring out how to fix the error I am getting on one of my variables. I'm trying to express my 'hashtag' variable (h) in terms of my space ...
0
votes
1answer
73 views

pset1 hacker1 mario.c, error while checking

this is my code, please tell what's wrong with it #include <stdio.h> #include <cs50.h> int main(void) { int height; do { height = GetInt(); }while(height<=0 || ...
0
votes
1answer
95 views

CS50 PSet 1- Errors with Pyramid output , help!

I am having issues with aligning the hashes and spaces, I have looked at this for a while and need some support...appreciate any help for in advance... my code is shown below with output #include <...
0
votes
1answer
17 views

mario hacker version. “Variable not used” error, but it feels like i am using it

Apparently h0 is 'unsed', but im using it in my for loops. What needs to happen for something to be considered 'used'? Why is it like this? Here is the code and error respectively CODE: #include &...
0
votes
1answer
99 views

Could someone pls help me with pset1?

i have been trying to solve this problem : :) 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 ...
1
vote
3answers
165 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 ...
0
votes
1answer
55 views

Check50 Issues When Debugging

#include <cs50.h> #include <stdio.h> int GetPositiveInt(void); int main(void) { int height; printf("Enter the height of the pyramid: "); height=GetInt(); while(...
1
vote
1answer
121 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) { ...
0
votes
1answer
32 views

12 errors for pset1 mario

So complete rookie i saw functions from other peoples code n stuff #include <stdio.h> #include <cs50.h> int main(void) { int h, i, s, k; //get user input and follow limitations ...
1
vote
1answer
160 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, ...
0
votes
2answers
162 views

Pset1 Mario.c - How to Approach

I watched the walkthroughs and shorts for problem set 1 Mario, and I was able to properly get the pyramid's height. However, I am struggling to figure out how to loop through the pyramid's height. How ...
0
votes
1answer
25 views

mario pset1 increasing function doesnt seem working

When I use this code, hash-tags don't increase at all, and the rows stay the same. #include <stdio.h> #include <cs50.h> #include <math.h> int main(void) { int n; int i; ...
1
vote
2answers
277 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: "
0
votes
1answer
92 views

Pset 1-Do While Loop Not Working

I cannot figure out why the do while loop does not re-prompt the user for a number when the user input falls outside of the range indicated by the boolean expression. Any ideas? Code below: #...
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
1answer
274 views

Help with mario- check50 error

So my program works (or at least I think it does, the output is what I expect to see), but when I use check50 it's still giving me a few errors. The code is here: https://gist.github.com/anonymous/...
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 ...
0
votes
1answer
97 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
1answer
90 views

check50 error message: I'm not sure what is wrong with my mario code here

the error I keep getting says: :( handles a height of 0 correctly \ expected an exit code of 0, not output of "Type an int between 1 and 23 to build M..." however, if user types a 0, my loop ...
1
vote
2answers
68 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
2k 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, ...
0
votes
1answer
42 views

Second condition doesn't seems to work properly

I've just solved my mario.c pset1, everything seems to work, but when I enter a value over 23 like 50 or so, the code is still running and drawing the pyramid then re-prompt the height. I've tried to ...
0
votes
1answer
121 views

What is the difference between 'printf(“ ”);' and 'printf(“%s”,“ ”);'?

Iam currently working on pset1 mario .when i used printf(" "); to print spaces before hash it didn't work as expected.but then i used printf("%s"," ") it works now .what is the reason behind this?
0
votes
1answer
58 views

Mario bug: Why won't “b” increment as intended?

I'm really close to solving this problem but can't seem to figure out why I'm not getting the correct result (i.e. a pyramid made of #'s that looks like this: http://cdn.cs50.net/2016/x/psets/1/pset1/...
0
votes
2answers
194 views

What is wrong with this mario pset1?

#include <stdio.h> #include <cs50.h> int main (void) { int n; do { printf("Height: "); n = GetInt(); if (n == 0) { return 0; ...
1
vote
1answer
295 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 ...
0
votes
2answers
116 views

Check50 is rejecting my code even though code works

#include <stdio.h> #include <cs50.h> int main(void){ int n; do{ printf("height: "); n=GetInt(); if((n <= 0)||(n > 23)){ printf("height: "); n=GetInt(); ...
0
votes
1answer
136 views

Trouble with first row of Mario.c

This is my code for pset1's mario problem but everytime I enter a height, the output of the pyramid always has the first row row with an extra space? What am I doing wrong? Could someone please guide ...
0
votes
1answer
191 views

Mario.c I don't understand how to print the pyramid?

I've been stuck on the Mario.c problem and I really can't seem to understand how to print the # and spaces. So far, I understand the pattern formed but what am I doing wrong? Could someone please ...
0
votes
1answer
91 views

pyramid loop in mario does not execute

My prompt and validation works already. The program compiled. But when I run it and enter a valid height, it does nothing. It seems like my loops don't execute. Now I have changed a few things to ...

1
3 4
5
6 7
10