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
119 views

Please help!! Pset 1: creating a pyramid

I have been struggling with pset1: creating a pyramid for a long time. I am reading other people's codes to learn the logic but I still cannot understand what is going on. Would you please explain the ...
0
votes
1answer
99 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
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
463 views

pset1 Mario. Spaces work, hashes don't and i can't see why

So I have been working on CS50's pset 1, making marios half pyramid. I have been looking over other problems on this site and I've gotten this far. But I can't seem to see what the problem is with my ...
0
votes
3answers
265 views

loop questions with mario

hi i'm having trouble with making the pyramid in regards to the for loop for (int x = 0; x < n; x++) am i supposed to look at x as starting as first row? if so, is the second for loop be the ...
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 ...
0
votes
1answer
195 views

Still needing help with Mario pyramid construction

I can't figure out how to make the pyramid work. My current code from the //create pyramid onward is: //create pyramid for (int k = n; k+1<n; k++) printf("%d", k); printf("#"); ...
0
votes
1answer
105 views

pset1/mario.c compiling erros

I have tried solving the issues and looking for answers everywhere but mario doesn't compile. When I try to make mario, it shows me the error message below. I removed the ; in line 24 after such ...
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
1answer
405 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
1answer
54 views

pset1 mario uncomf - Hash's start in wrong place

I've ran into what appears to be a problem. I initially thought I finished this pset but when I was checking my work I noticed the #'s always started from the 8th character along the line? Even if I ...
0
votes
2answers
183 views

pset1 mario Initializing for loop from GetInt

I'm running the Mario program and I have everything working except the correct count, which I can fix. The only issue I'm having is a syntactical one. I'm tying to initialize the "for loop" with the ...
0
votes
1answer
133 views

Mario syntax error

Something's wrong with my function declarator, and i have a different error that I don't understand at all. Please help! Here is the code: #include <stdio.h> #include <cs50.h> int n; ...
0
votes
1answer
332 views

pset 1 mario space help

I am having a problem printing the spaces. The code I have gets the number as required. It prints out the number of hashtags desired based on user input. However, there are no spaces. Where can I ...
0
votes
1answer
43 views

Prompt a user for a number. My code has an endless loop

i am trying to build a code in which the user should input a number between 1-5. In any other case the program should request the user to input a new number. My problem is that the program is going ...
0
votes
3answers
288 views

I'm having trouble printing the hashes and spaces. I've started with this, but it doesn't seem to work. Any ideas?

My code is down below. Everything above the for loop is fine. I need help with printing spaces and hashes. #include <stdio.h> #include <cs50.h> int main(void) { int h; do { printf("...
0
votes
1answer
2k views

Mario Less Comfortable, do-while loop problem

Hi everyone I made sure to do my research and go through the already posted questions. I am certain my while condition is wrong after research but don't understand the correction. my program runs but ...
0
votes
1answer
453 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
1answer
181 views

pset6 how do we check for string in mario

I've tried to find out how to check for string input for mario.py. I know to check for the range of integers when getting input from the user, but if they enter a string instead of a number, is there ...
0
votes
2answers
139 views

Why isn't my block on pset1 turning into a staircase?

I am currently working on pset1 Mario, less comfortable. I am running my c to turn the hashtags into a staircase, but when I run the code, it is only a block. What is wrong with my code? Thank you all ...
0
votes
1answer
126 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
3answers
177 views

pset1 mario. can't fix errors, please help!

I can't understand what's wrong with the code. I've changed it many times, but errors are always similar.Can anyone please check the code and tell what's wrong?
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) { ...
1
vote
2answers
125 views

Weird problem - gedit isn't saving changes to my mario code

I've restarted it several times, saved the code under another name and done everything I can think of but it isn't using the changes I've made. For example, I used dots to make the pyramid so I could ...
0
votes
1answer
204 views

Mario pset1 a little hand please!

Spoiler alert code inside this link! !http://imgur.com/OIHvPFC I am having trouble with the mario, any tips of how i can get on with this? I have listed my integers at the start but maybe i over ...
1
vote
2answers
881 views

pset1 mario: please help with my code

The below is what I have come up so far and the result is very underwhelming. It just doesn't work out as I expected. The first part works well but I am struggling with the second one. Any help would ...
0
votes
1answer
21 views

I keep getting the following error when I use the Check50

You seem to be missing these required files: mario.c You are currently in: ~, did you perhaps intend another directory?
0
votes
1answer
159 views

I can get the correct height for my pyramid but I can't get the spaces or #s to add or subtract properly in my loop

{ for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { printf("%d\n", j); } for (int k = n; k < n + 2; k++) { printf("#"); } printf(" \n"); return (0); }
0
votes
1answer
128 views

Pset 1 Less comfortable - Number of Hashes

Sorry for the beginners's question. When I try to compile to following code for the Mario - Less Comfortable problem, I am printing the same number of hashes for each row and am unsure why. Code is ...
0
votes
2answers
106 views

mario less comfortable help

I wrote this code for the mario problem but idk if it's right. i'm having trouble running it. It keeps saying error: linker command failed with exit code. #include <cs50.h> #include <stdio.h&...
1
vote
1answer
87 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
2answers
3k 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
731 views

I keep getting error: use of undeclared identifier 'n' when trying to compile mario.c. I am new to coding, my code is shown below

#include <cs50.h> #include <stdio.h> int get_positive_int(string prompt); int main(void) { { int i=get_positive_int("Height:"); } for (int i = 1; i < n; i++) ...
0
votes
2answers
252 views

pset1 Mario trouble

I've been working on this for days now, and have reached a point where I'm afriad I've gone further away from the LOGIC of the problem. At the moment, the complier doesn't print out line 16 and yet ...
0
votes
1answer
187 views

Stuck at pset 1 mario problem

I'm Stuck at the PSET 1 problem of CS50. for height 3, my output is coming as ..# ..## ..### Can any peers or experts, look into my code and help me out. [EDIT: code removed for Honor Code ...
0
votes
1answer
120 views

pset6 mario/more - output is seemingly correct, however failing tests

I've just finished mario/more in pset6, however, it does not pass the tests. The actual and expected outputs are identical, so is the expected string. The pyramid also looks identical to the c ...
0
votes
1answer
13 views

error: expected identifier or '(' I thought I had solved this

#include <cs50.h> #include <stdio.h> #include <math.h> int n; { do { n = get_int("Height: "); } while (n < 1 && n < 8); for (int i = 0; i < 8; i++) { ...
0
votes
2answers
30 views

mario more (python)

I've tried to make my code efficient by reducing the number of loops/print functions compared with my solution in c. My code works, but check50 isn't happy with it -- apparently an extra space is ...
0
votes
1answer
29 views

Could someone explain to me how curly braces work?

#include <cs50.h> int main (void) { int height; do { height = get_int ("Enter Height"); } while(...
0
votes
1answer
107 views

MARIO!! just look over

what in the world is wrong with my code: #include <stdio.h> #include <cs50.h> int main(void) { int n; do { // prompt user for a number 0 to 23 n = get_int(); printf ...
0
votes
1answer
44 views

Help please with code Mario error

#include <stdio.h> #include <cs50.h> int main(void) { int pyramid_height = 0; do { printf("Height:"); pyramid_height = GetInt(); if (pyramid_height == 1)...
0
votes
1answer
123 views

Finished Mario week 1, but unsure if it's a proper solution

So I managed to get the intended result for Week 1 problem set 1 Mario (less comfortable), but I'm not sure if my solution would be considered good code. In line 11, is it ok to have subtracted by 1? ...
0
votes
3answers
522 views

check50 is getting a different result from me on mario

I have tested every criterion of Mario, and they all are met, but check50 is getting a different output than me. Here is a transcript of what happened. elephant1123@ide50:~/workspace/pset1 $ ./mario ...
0
votes
4answers
696 views

mario.c; error message: expected identifier

I have been trying for more than a week to correct compiling error: mario.c:19:1: error: expected identifier or '(' The response I received did not help. #include <cs50.h> #include <stdio....
0
votes
1answer
31 views
0
votes
1answer
62 views

CS50 Terminal saying there's error in code that isn't there - More Comfortable Mario

Whenever I type Make Mario into the Terminal for the "More Comfortable" Mario.c assignment in Week 1, it keeps telling me I have an error on 13:9 - but there's nothing typed on 13:9. I'm a bit ...
0
votes
1answer
32 views

make mario won't work but i'm in the correct directory

make mario won't work but I'm in the correct directory. I haven't even started writing the solution properly as I'm stumped on getting it to compile. Any suggestion? I tried restarting the IDE and ...
0
votes
1answer
45 views

cs50 mario MORE comfortable need LOTS OF HELP

so ive been stuck on this problem for a about a week, took lots of note and downloaded the lecture just look back on even took notes for the shorts on week one. now what i clearly need is to be taught ...
0
votes
1answer
73 views

Failed to write to 'mario.c'. Failed to retrieve resource from vfs-gce-usw-289-4.c9.io

I ran Mario and one of the loops repeated forever. I exited the terminal and now I can't compile. I get this error message: Failed to write to 'mario.c'. Failed to retrieve resource from vfs-gce-usw-...
0
votes
1answer
38 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 &...

1
2 3 4 5
10