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
62 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
119 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
143 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
92 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 ...
0
votes
1answer
186 views

Mario pyramid loop arithmetic question

So I've got the program up and running, I'm just trying to understand exactly why it is performing correctly. I'm confused on this: for (rows = 0; rows < height; rows++) { for (spaces = (...
0
votes
3answers
175 views

Mario pyramid code not working

This is my code. What's wrong with it? #include <stdio.h> #include <cs50.h> int n; int main(void) { do { printf("How many blocks would you like Mario to jump?\n"); n = GetInt();...
0
votes
1answer
121 views

Pset1 problem with mario spaces

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

CS50 PSET1 - Mario / Greedy - Expected prompt for input, not exit code of 0

Mario and Greedy seems to output the same errors for me. It is frustrating, because they do what they are "supposed" to do. So I can't figure out how to solve the error. I looked through the others ...
0
votes
1answer
110 views

Is it possible to write mario.c using just "if" and "else if" conditions?

Most mario.c codes rely on using the "for" loop for incrementation of the rows, spaces and hashes. But is it possible to use entirely if conditions alone to dictate the incrementation of these ...
0
votes
1answer
160 views

What is wrong with my hacker mario.c code for pset1?

I managed to complete the hacker version of the mario.c problem in pset1 using "for" loops. However, when I re-tried the problem using "if" and "else if", I could not achieve similar results. Here is ...
0
votes
1answer
153 views

mario not working

for (int i = height - 1, i >= 0, i--) { for (int n = 0, n < i, n++) ... for (int j = 0, j < total, j++) [EDIT: irrelevant code removed for Honor Code compliance.] This is ...
0
votes
1answer
137 views

Check50 not working with mario problem

I don't know if anyone else had this problem, but I believe my code is giving the correct output but check50 does not validate it. Below a picture of the error and a general output of my code: Any ...
0
votes
1answer
336 views

pset1-inverted pyramid

i know this may have been asked quite some times but i have gone through many of the answers here and on other websites and i just can't understand them. the pyramid is printing OK but it is inverted, ...
0
votes
1answer
343 views

infinite loop for mario.c

I'm almost there in solving the pset1 of cs50 mario.c the problem in my code is when i enter a number more than 1 and less than 23 , it goes in infinite loop and prints spaces all the way without ...
0
votes
1answer
156 views

pset1 mario check error but output is correct

not really sure whats the problem here with cs50 check need help https://sandbox.cs50.net/checks/aa951be0d4b640178ac6fababe0d6dfb
0
votes
2answers
349 views

pset 1 help please

I am having trouble with problem set 1 and could use some help please! Specifically, I am having problems generating the blocks in a pyramid. I have watched the walk through but am having trouble ...
0
votes
1answer
72 views

pset 1 mario.c issue with it looping until its above 0 or below 24

I want it to loop my printf statement until they give a proper answer from 1 to 23. #include <stdio.h> #include <cs50.h> #include <math.h> int main(void) { do { printf("a ...
0
votes
1answer
276 views

CS50 Pset1 mario.c Stuck!

I am completely stuck with the hashes for this problem set. I've read thru a bunch of different forums and questions already posted, but i honestly have no idea what to do. Every time i try to change ...
0
votes
2answers
202 views

Mario/PSET1 - Don't even know how to start - So confused

I have watched several videos and they confuse me further. I'm really struggling with mario and would love if someone could walk me through the general scenario as to what I need to do. Thanks.
0
votes
1answer
905 views

cs50 mario, expected output, not an exit code of 0

How could i fix the exit code of 0 fault? please. jharvard@appliance (~/Desktop/hacker1): check50 2014.fall.hacker1.mario mario.c :) mario.c exists :) mario.c compiles :( rejects a height of -1 **\...
0
votes
1answer
364 views

pset 1 error "expected expression" if else statement, mario

I get the error "Expected Expression" on line 45:9 at the else statement in the for else loop. Any ideas? I've been working on this pset for around 7 hours but can't figure it out. // Includes ...
0
votes
1answer
456 views

Problem with the Do While loop for Mario

I am testing the first part of my code for Mario, pset1. I am using a do while loop because I thought the 'while' will return to the 'do' part if you put in a invalid number. But when I use the ...
0
votes
1answer
740 views

Mario Pyramid Upside down

I've finally gotten mario to behave how I want it to...except now it prints upside down. Here's my code. int main(void) { //Grabs height from user between 1 and 23 printf("Please enter a height ...
0
votes
1answer
42 views

(mario) My variable for the height of the steps doesn't seem to be getting stored?

My code for mario's steps doesn't seem to be storing the stepHeight variable, and it's driving me crazy. Is it because of scoping? If so, how would I get the value to stick around after the do while ...
0
votes
1answer
233 views

Help! I am stuck on Mario-pset1. Pyramid

I am stuck on Mario. I keep getting a "redefintion" error in my loops when I try to make the pyramid. My problem is in the conditions part of my for loops, I think. // Get a number for building the ...
0
votes
1answer
93 views

Hacker1 seems to run properly, but won't pass check50

I completed pset1 but I seem to have some problem running the Check50. when I put my output next to the one provided for testing, it seems the exact same... I tried to use an array with chars, is it ...
0
votes
1answer
125 views

Pset 1 Bug with Do While Loop

My Do While Loop isn't working for some reason, the error is outlined below. Can anyone help me figure this out (I included the stdio and cs50 libraries)? int main(void); int n; { // error: expected ...
0
votes
1answer
190 views

Problem with Else if statement

I have a problem with the else if statement. It only prompts one time and if the number is still incorrect then it is just ends. The else statement is working fine for as long you write something else ...
0
votes
1answer
288 views

Trouble with mario pyramid

So, I've been working on mario for some time, and I've pasted the code I've made, which is faulty but I have not idea how to fix it. The program is telling me that for the line "for (int i = 0; i < ...
0
votes
1answer
283 views

While uploading mario to check50 I get E_UNKNOWN error. Why does this happen?

As answered in one of the question.i tried running update50 from the command line and my appliance is up to date and Restarted the appliance.Still i am getting the same error. When i got the error my ...
0
votes
1answer
316 views

:( rejects a non-numeric height of "" \ expected output, not an exit code of 0

I have done my mario.c all correct but the cs50 check says :( rejects a non-numeric height of "" \ expected output, not an exit code of 0 As far as I tried to understand I think it means I am not ...
0
votes
2answers
462 views

Pset1 Mario - pyramid output

Pset1 Mario - I am able to print out one space and one hash per line baed on the users input number (8 lines, 12 lines, etc) however, i can't seem to get the n+/- equations incorporated with the ...
0
votes
1answer
174 views

The CS50 mario code validator isn't working?

I'm trying to check my Mario code and seem to be getting this issue: jharvard@appliance (~): check50 2014.fall.pset1.mario mario.c Compressing mario3.c... Compressed. Uploading...... Uploaded. ...
0
votes
1answer
163 views

Mario Pyramid - trouble with printing structure

I'm having alittle trouble having my code create the pyramid for Mario. The code that is below prints out the user input but lets say the user puts in 4 it would print out vertically. ## ## ## ## ...
0
votes
1answer
81 views

Mario loop not working

I am stuck. I can only get one line to print a # and my spaces are correct. I am new to C and it is either scope is wrong or my logic is just off. I need to get unstuck and hints would be great. ...
0
votes
1answer
304 views

pset 1 Mario's half-pyramid

My windows works slowly, so I installed a standalone Ubuntu 32-bit. here's my code: /** * mario.c * * Kiril Reznikovsky * kirilrez@gmail.com * Builds a half-piramid according to given height */ #...
0
votes
2answers
105 views

Want to do some advance skill on mario.c!

I have completed Mario.c and now I want to some advance skill on mario.c Like: I want to ask user that how many pyramid they want to have because by default it will only show one pyramid and different ...
0
votes
2answers
243 views

Spaces help Mario

Ok so after a lot of effort I decided how I wanted to get the spaces done. Now this seems like a tiny problem to me: the multiplication sign doesn't work, the terminal ... like doesn't recognise it. ...
0
votes
2answers
117 views

Why do I get 0 even though mario passes the tests?

I submitted pset1, mario. despite passing all the checks, I got a big fat 0! any ideas why?
0
votes
1answer
330 views

Why does my code fail check50 tests?

When checking with check50, I get these errors :( handles a height of 1 correctly \ expected output, but not " ##\n" :( handles a height of 2 correctly \ expected output, but not " ##\n ###\...
0
votes
2answers
260 views

what is the problem with my mario?

I am working on mario and I am stuck. Here is my code: I have the user input part right and I see how I can manually copy paste and tweak the program to work all the way to 23 hashes, but I know ...
0
votes
1answer
107 views

pset 1 Mario - clang error - printf syntax error? won't allow /n at end of printf line - error code

I'm a complete newbie to code writing. I'm working on the mario pyramid project. I'm writing the following lines of code and when I run MAKE I get an error in the compiler. here is the code I've ...
0
votes
2answers
138 views

Can't pass 1 last check for pset1 mario

I was trying to finish the mario assignment in pset1. For some reason, I couldn't use GetInt() or GetString() at all, and my variable receives no value when I used those functions. Thus, I had to use ...
0
votes
1answer
694 views

Error: Expected Expression

During Problem Set i came across the error Expected Expression on the statement "string s = GetString();" Suggestions would be appreciated. The code is provided below. #include <cs50.h> #...
0
votes
2answers
631 views

Pset1 Mario: I'm getting same number of spaces and hashes on all lines

I understand the pattern that I need to create. I have drawn it all out on paper. I have watched every single lecture/section/short/walkthrough video. I have Googled. I still don't understand how ...
0
votes
1answer
558 views

Mario help! Spaces and hashes do not match the code

This is what my program outputs: Please give me an height for your tower between 0 and 23. 4 ....### ...## ..# . jharvard@appliance (~/Dropbox/pset1): The meat of my code for running this is below: ...
0
votes
1answer
268 views

pset1, mario: getting past the prompt for an int

I can get to the prompt, input an int and get a reasonably expected response such as a simple "thanks for the int". Beyond that, though I have read all the material and watched all the videos from ...
0
votes
2answers
128 views

How to solve the error occured on mario.c

whenever I use check50 to check my code, I get an error saying that "rejects a height of 24" and in that error the error is specified as "Takes in standard input of 23......but received an exit ...
0
votes
2answers
74 views

For some reason x won't increment. Please help

I can't figure out why x won't increment. here is the block of code. I already have y declared as the users input. for (whatever reason) { int x = 2; int h = y - y + x; x++;
0
votes
1answer
117 views

Mario - pset1. Need some advice into code creation

I need some advice into how to write the code. I'm new to C... I'll show you guys my code. There is something very wrong in this code, But I need help to see how to do it right. Please, guys, don't ...

1
4 5
6
7 8
10