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
552 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
38 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
79 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 ...
1
vote
1answer
240 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
834 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
183 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
136 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
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 ...
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
300 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
127 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
263 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
180 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
407 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
574 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
120 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
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 ...
0
votes
2answers
229 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
104 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
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 ? ...
0
votes
2answers
131 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
219 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
274 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
274 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
129 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
75 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
96 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
173 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
58 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
122 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
33 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
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, ...
0
votes
2answers
165 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
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: "
0
votes
1answer
96 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
279 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
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 - ...

1
3 4
5
6 7
10