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
2answers
730 views

bash: ./mario: Permission denied in Mario problem pset1

I think I wrote my code correctly. I used the same algorithm in Java and it gave me the perfect output. Can someone please tell me what's not working for this one and why it wont even comiple? mod: (...
0
votes
1answer
345 views

So Close on Mario Pyramid

I've finally gotten some loops nesting properly and building a type of pyramid. I'm not sure where I've gone wrong that the hashes are repeating a few times on the same line and the spaces (rendered ...
0
votes
1answer
132 views

Having Trouble tackling corner cases for Mario

I am having issues tackling the corner cases for Mario (e.g. height < 0 or height > 23). I'm assuming you prompt the user to keep entering an integer in a while loop until he/she has entered an ...
0
votes
3answers
918 views

do while loop not working?

I used these condition in do while loop , and I still getting the forever loop. It just doesn't stop. while( x > 0 || x < 23);
0
votes
5answers
422 views

Errors Running mario

A few days ago, this program ran correctly, but now it's showing errors. I tried to find the problem, but I don't understand what these error message mean. What am I doing wrong? jharvard@appliance (~...
0
votes
2answers
41 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
3answers
318 views

PSET6 Mario Python

I have been experiementing with this code for a couple hours and have come across an issue with each implementation. I can no longer put in any time at the moment so I figured I would go ahead and ask....
0
votes
1answer
101 views

My 'pset1 Mario more comfortable' is returning check50 errors whilst seemingly correct

I saw this question has been asked in multiple ways before but I believe I've checked answers and am still stumped as to the issue I have. The output for my pset1 Mario more comfortable appears to be ...
0
votes
1answer
374 views

MarioLess - declaration shadows a local variable error

Any suggestions on how to fix this error? "mario.c:10:14: error: declaration shadows a local variable" Code sample below. Thanks in advance! #include <cs50.h> #include <stdio.h> int ...
0
votes
1answer
471 views

Struggling with Mario (less comfortable) loop conditions

Been struggling with this a few times now and have inserted some additional printf commands to try and understand what's going on with the variables used to control my loops (please see instructions, ...
0
votes
1answer
41 views

running into a do...while loop issue

I am having an issue with output from a do while loop. Code is below do { printf ("Height:"); height=get_int(); } while (height < 0 || height > 23); it works for negative numbers ...
0
votes
1answer
28 views

Another question about how my 'for' parameters are affecting my output?

After some manipulation and trial/error, I finally got my code to output the desired spacing for the half pyramid. However, I am having trouble understand one of the relationship between my condition ...
0
votes
2answers
3k views

i am unable to submit my work in pset1 of marioless. It shows me a comment in yellow which says invalid slug.What should I do?

~/workspace/ $ submit50 cs50/2018/x/marioless Connecting.... Invalid slug. Did you mean to submit something else? ~/workspace/ $ submit50 cs50/2018/x/marioless Connecting..... Invalid slug. Did you ...
0
votes
1answer
46 views

cs50 wrong analysis of mario/more

Following it's analysis where it says my program is wrong, yet it is as it should, also there is nothing after the "#": :( handles a height of 1 correctly expected "# #\n", not "# # \n" :( handles ...
0
votes
1answer
39 views

do while mistake , please give right code

#include <cs50.h> #include <stdio.h> int main(void) { do { int n=get_int("positive no:"); } while(n<=0); for( int i=0;i<n;i++) { printf("#\...
0
votes
2answers
106 views

Problems on mario (pset1)

I want to test how the do-while loop works. But I encounter a problem, which I've spent an hour working on but couldn't figure out a solution. Here's my code. int main(void) { int n; do { ...
0
votes
1answer
202 views

Help with Mario - expected expression/identifier

I'm struggleing with syntax I think. I keep getting errors with expected expressions/identifiers. I've tried to mimic code I've seen, but I'm not getting it...I'm just trying to set my input and it'...
0
votes
1answer
378 views

Can anyone please help with mario less comfortable?

:) mario.c exists. :( mario.c compiles. expected exit code 0, not 1 :| rejects a height of -1 can't check until a frown turns upside down :| handles a height of 0 correctly can't check ...
0
votes
1answer
123 views

pset1 mario - hashes output

I managed to print the correct number of spaces. However, when it comes to the hashes, im stuck in 2 per row instead of increasing by one the number of them as the number of rows increases. Any help ...
0
votes
1answer
56 views

Pset1 Question Mario

So I figured everything out except why when I configure the program it doesnt print anything. No hashes no spaces! #include <cs50.h> #include <stdio.h> int main(void) { ...
0
votes
2answers
40 views

Give a Function access to earlier value

If the main block of code gets a value from the user, assigns it to an integer, and then changes that interger's value, is there a way for a function (created outside the main block of code) to access ...
0
votes
2answers
43 views

Have looked all over the web. Can't figure out: Error: expected identifier or '(' {

I've had this problem since the beginning. I got error messages saying it expected a semicolon after int main (void), and this one has been persistent. It tells me it expects an identifier '(' instead ...
0
votes
2answers
608 views

(CS50 mario.less)Please point out the mistake in my code.(pset 1)

I need your assistance with my code foe CS50 problem set 1, the mario(less comfortable). I seem to have a few problems with the logic inside my code. Would you mind pointing out the mistakes? I would ...
0
votes
2answers
132 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 ...
0
votes
2answers
136 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
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 ...
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
246 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
6k views

Getting an error error: expected identifier or '(' {

#include <stdio.h> #include <cs50.h> int main(void) int h; { do { printf("Height: "); int h = GetInt(); } while (h < 1 || h > 23); } clang -ggdb3 -O0 -std=c11 -Wall -...
0
votes
2answers
916 views

Problem printing spaces on Mario

I've been looking here on Stack for a solution to my problem and couldn't find one. My code seems to work properly, besides the spaces that looks like, are not beeing printed. Here's the code: int ...
0
votes
1answer
165 views

Help! pset1 - mario.c - "illegal file in check" when using check50

I am working on the mario.c file for pset1. When I test my code manually it seems that everything is working perfectly. Below is some code /* * Program: pset1: mario * * * Created by: ebrady * ...
0
votes
1answer
377 views

Pset1 Mario: I don't understand my own solution, why does it start with two hashes if the value is set to 0?

So I logically figured out everything but the hashes. I mean it executes correctly, but why?? Why does the first line start with two hashes??? Isn't the initial value zero? It increments by one, but ...
0
votes
1answer
152 views

Almost (maybe) done!

UPDATE Good afternoon; would you please help me to finish this; I don't know how to put correctly the spaces of the pyramid. int main (void) { int row; int space; int hash; for (row = 1; row <...
0
votes
1answer
509 views

PSET 1 Mario pyramid ALWAYS prints upside down

I haven't yet found an answer in these forums to address my problem(s). My issue has three components: The pyramid output is upside down. I get the right number of spaces and hashes (first output ...
0
votes
1answer
53 views

Specifics of grading, and indivudality in coding

I recently did the mario.c code, and it works perfectly. However, while running CS50, I'm getting :( faces due to the fact I re-prompt with the same text when they enter a 0(enter a number between 1-...
0
votes
1answer
163 views

hacker1 mario: output appear correct, but won't pass check50

I have fiddled around with it a bit. I thought it might be the extra spaces after the second half-pyramid, but I removed them and I still can't get it to work. I appreciate the help. Thanks!
0
votes
2answers
328 views

I need help with Pset1 Mario

I have been able to print the half pyramid but its backwards (its the right half on the pyramid instead of the left). I believe it must be something to do with my spaces and perhaps not my hash's. I'm ...
0
votes
1answer
624 views

Can't get past user input in Mario

Can't understand why this doesn't print nothing when I give the integer within the parameters...just keeps asking for an integer no matter what the user input is
0
votes
1answer
99 views

pset1 mario - correct repetitions displayed but not correct number of hashes or spaces

I'm trying to do mario problem -- can't figure it out. I watched Zamylas' walkthrough, watched all the videos, but I can't get it right :-( Here's where I'm at: http://s9.postimg.org/6qqh563y7/...
0
votes
1answer
279 views

Please please help newbie complete Mario!

I can ask for and get user input. I believe the best way to handle the rest is nested for loops where the 1st gives the lines with user input, and the other 2 give the spaces and hashes, that's where ...
0
votes
2answers
709 views

pset1 "expected identifier error in do-while loop

I have been struggling with this for weeks now, have done several searches and posts and can not seem to get around this. I have tried everything and it just makes it worse. I wish there was a video ...
0
votes
1answer
164 views

pset 1 Mario problem

Guys I've been at this a while. I get the expected outputs except for 0 but can't pass check50. I assume there is something problematic with my while loop. All help appreciated as Im trying to learn ...
0
votes
2answers
212 views

Incorrect mario.c when using check50

I'm getting some errors when I run my code through check50 such as handles a height of 0 correctly, handles a height of 1 correctly, handles a height of 2 correctly, handles a height of 23 ...
0
votes
3answers
328 views

Mario Hacker Edition Checkcs50 - failing

I am not able to understand why this program failing in Checkcs50. For input 1 and below it works fine. For input above 23 or invalid input it works fine. But for values 2 to 23 Checkcs50 failing ...
0
votes
3answers
132 views

Mario issue - keeps making blank spaces (infinite loop)

I am looking at this code I made for the hashes and spaces, and in my head it seems correct. However, it obviously is not since when I run it, it just keeps going and going. I guess it is called an ...
0
votes
1answer
151 views

Having a bug in the mario.c program

I have done the mario.c prg, it works, but there a small bug. I have put a check for numbers between 0 and 23, but what if user enters an alphabet or a special character. In that case my terminal goes ...
0
votes
1answer
596 views

Help needed with creating the pyramid in pset 1 Mario

It's been quite a while since I've been trying to create the pyramid.Here's the code that i have written.Please check it out and tell me where I made a mistake.
0
votes
3answers
195 views

problem with pset1 mario

I have been working on pset1 for a few days now and can't figure out, for the life of me, what my error is. I've gone about it a million ways and I'm stumped halfway. I'll be attaching the gedit code ...
0
votes
1answer
73 views

Nesting multiple while loops does not work

I tried nesting a few while loops so that I could give different responses depending on the users answers. But it does not work. Entering a smaller number, say -9 immediately stops ends the program ...
0
votes
1answer
514 views

Do - while is not working as expected in mario.c

I am in pset1 mario.c. I have created the program but there is a bug. I have initialised n = 0 and when I execute my program and put any value greater than 23 or less than 0 it is prompting me again ...

1 2
3
4 5
10