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
1
vote
1answer
15 views

CS50 mario pset 1 error: expected '(' after 'do/while'

Here is my code: #include <cs50.h> #include <stdio.h> int main(void) { int n; do { printf("height: "); n = get_int(" "); } while { (n < ...
0
votes
0answers
18 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
1answer
30 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
61 views

Pset 1 mario (less comfortable)

I've been working on this problem for days and I can't figure out how to print the right side of the pyramid. I"m able to print the left side, preceded by a space (denoted by "y) and one hash. I've ...
0
votes
1answer
79 views

pset 1 Mario code starts with an empty row

I think I got most of it already but I have one issue that I don't see how to solve. If I make the height 8 (for example) it'll print 1 empty row first and then 7 rows with hashes, the last row will ...
0
votes
1answer
72 views

:( rejects a height of 9, and then accepts a height of 2 expected exit code 0, not 2

I have done my mario.c all correct but the cs50 check says: ':( rejects a height of 9, and then accepts a height of 2 expected exit code 0, not 2' Why I have this problem? Idon't understend. When I ...
0
votes
1answer
81 views

CS50; PSet1; Don't know how to connect for loop with user's input + expected identifier or '(' error

I don't know how to properly connect user's input part and for-loop(which is incorrect) in this program. I was seeking for how to do this but didn't find anything useful. Here are my code: #include &...
0
votes
1answer
124 views

CS50 Mario Less Comfortable Printing Pyramid

I have been working on this problem for about 2 weeks. I can receive input from the user and print hashes based on the number the user entered. However, I can't print a right aligned pyramid made up ...
0
votes
1answer
73 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
79 views

Can’t see my error on Mario for loop, rows won’t execute!

I’ve gotten stuck on the Less Comfortable Mario set: the height input portion works, but the loop does not execute. I really wanted to figure this out on my own, but I’ve been stuck for days! Please ...
0
votes
1answer
93 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
1answer
127 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, ...
1
vote
1answer
141 views

Doing mario.c less comfortable one step at a time

Like many others here I am completely new to coding. No experience whatsoever. I have been busy with the less comfortable Mario.c for a while now, trying to understand what is going on every step of ...
0
votes
0answers
53 views

Pset1 mario only executing do-while loop

So i've spent way too much time on this. Didnt expect it to be so difficult. I think i got the coding right but for some reason the program is only executing till the do-while loop and then it exits ...
0
votes
1answer
82 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? ...
1
vote
2answers
74 views

I don't know why check50 HATES ME?! mario.more

Here's my code for mario.more. [removed solution code] When i execute this code, it performs exactly how it should look according to Walkthrough: But when I run check50, the terminal goes like ...
0
votes
3answers
199 views

I am ABSOLUTELY STUCK! (mario less)

Ok, I have tried and have gotten a 60%. I need at least a 70% to pass. Please. Help. Me. Please. Tell. Me. What. Do. I. Do. I am done cash and now I'm stuck on this! Here is my code: #include <...
0
votes
1answer
67 views

It doesn't work?!!! (Mario less)

Ok so this is my code: #include <cs50.h> #include <stdio.h> int main(void) { int n; do { n = get_int("Height: "); } while (n <= 0 || n > 23); for (int i = 0; i <= n; i++) ...
0
votes
1answer
34 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
68 views

Need guidance on Mario (Less Comfortable) Problem Set 1 (Pyramid upside down)

I recently got to trying to solve problem set 1, where I am required to print a pyramid with a user inputted value between 1 and 8 (inclusive). After a while, I got this code: #include <cs50.h> ...
0
votes
1answer
196 views

How to print out hashes in mario(less comfortable)? (2019)

Ok so this is my code I have right now: #include <cs50.h> #include <stdio.h> int get_positive_int(string prompt); int main(void) { int i = get_positive_int("Height: "); for (i = 0; i < ...
1
vote
1answer
390 views

Clueless on where to start for Mario (Less comfortable) in CS50 2019

I am currently in the process of finishing Problem Set 1 from CS50 2019, which involves creating a pyramid out of hashes. The pyramid must be made by the user inputting a number between 1 and 8 (...
0
votes
1answer
36 views

Problem Set 1 - Mario - Less Comfortable - 'expected identifer or '('

I recently started CS50 and I am currently in the process of completing Problem Set 1 - Mario (The less comfortable one). I am really confused by the hash pyramid problem, so I've been trying ...
0
votes
1answer
43 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 ...
1
vote
1answer
58 views

CS50 Pset 1 mario soluce

I have sent my code for the pset of mario, he is working but i have only 55% and i dont know why ! I have search the soluce on the web to compare but didnt found ! Can someone look on my program to ...
0
votes
1answer
86 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 ...
1
vote
1answer
48 views

tests give weird results despite (seemingly) correct output

I receive the test feedback expected "# #\n", not " # # \n" for the test running with n = 1, with the following code snippet called to for printing: for i in range(n): print( (n - i) * '...
0
votes
1answer
250 views

Pset 1 - Mario pyramid trouble with spaces/dots

So I was able to set up the prompt and the left aligned pyramid correctly, but really started struggling when trying to right-align it with dots in front of the hashes. For whatever reason, its ...
0
votes
2answers
42 views

pset1 always adding extra one space on each Hash row

#include <cs50.h> #include <stdio.h> int main() { int height; do { height = get_int("Enter the height between 1 & 8\n"); }while(height<1 || height>8); for(int i=0; i<...
0
votes
1answer
39 views

Why is condition being ignored?

I have the following code for C int get_pyramid_steps(string prompt); //Ask height int main(void) { int i = get_int("pick a number: "); printf("you said %i\n", i); } //if i < 1 or i &...
1
vote
1answer
197 views

Prompt for integer > 2 and < 8 in C

Really rookie question about C... I want the user to enter a number between 2 and 8, and if they don't, the prompt repeats itself until an integer within my parameters is entered. I can get this to ...
0
votes
2answers
37 views

Not In Directory In Terminal Window pset1/mario/less

In the terminal window the current directory is always shown on the line where a command can be typed in. While working on pset1/mario/less somehow I have created the issue by which the current ...
0
votes
2answers
178 views

Need help in pset1: mario.c

I've been trying to do the less comfortable version of mario.c for a while, here is what I've been able to put together so far: #include <cs50.h> #include <stdio.h> int main(void) { // ...
0
votes
1answer
82 views

Mario error: expected ';' at end of declaration…all solutions i've found fail

i've been wasting hours going round in circles. Frustrating that first steps of learning are this hard.][4] i;ve removed the semi-colon and moved the curly hash together and separetely to no avail.
0
votes
2answers
62 views

Pset1: Problem: expected “##\n”, not “ ##\n”

Program works like a charm but still get these errors in the end when running the check. Could not figure out the issue. Why ? Thanks
2
votes
2answers
476 views

PSET1:: Mario More Comfortable :: confused about check50 output

I am sorry if I miss something obvious here, but I am an absolute beginner. I get the following output from check50, which I am confused about: I will attach my code below, but my output for 2 is: ...
0
votes
1answer
39 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
27 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
1answer
39 views

Can someone help me understand what I am manipulating in the for statement?

Through trial and error, I have been able to get my pyramid close but not quite where it needs to be. I started with the hashes because it was difficult to interpret spaces in the output terminal and ...
0
votes
1answer
145 views

cs50 mario less comfortable eof error

new to coding and working on my pset1. Program works great, but I get this EOF error. Thoughts? Here's my code #include <stdio.h> #include <cs50.h> int main(void) { // declares the ...
0
votes
1answer
45 views

pset1 ---------— mario less

I am not understanding as to what is expected when it says " rejects a height of -1 expected program to reject input, but it did not" what is "reject input"? please help
3
votes
2answers
92 views

Which loop can be replaced for nested for loops for PSET 1 (Mario More Comfortable)?

According to the cs50 style guide for C, more than 3 variables for iteration is not a good practice. I have done Pset 1 (Mario more comfortable) with 5 for loops, so it has 5 iterations variables. Is ...
0
votes
1answer
34 views

mario and problems with my array

# include <stdio.h> #include <cs50.h> So I've been playing around with this problem alot and unforturnatly asked many questions. But I think I've figured out the basics, if not back to ...
0
votes
1answer
18 views

unable to locate “capitilize0.c” which David states is in cs50 website

unable to locate "capitilize0.c" which David states is in cs50 website
0
votes
1answer
59 views

cs50 pset1 mario math wrong or order?

So I'm working on mario less and running into a road block. I got it to output the space and rows and columns but it's upside down, backwards and not the right number of spaces exactly. Like if you ...
1
vote
2answers
43 views

Cs50 pset1 mario syntax errors or wrong code

Okay so I've tried multiple ways to get my blocks to simply create columns and rows first before adding spaces (though I've tried). I've watched and rewatched the lecture multiple times but I can't ...
0
votes
1answer
105 views

get_int variable in mario causing errors

Hi I'm getting an error that says "x" is an unused variable. And I'm also getting errors every time I try to use "x". I have reviewed David's get_int example from Lecture 1: int main(void) { ...
0
votes
0answers
35 views

Mario.py works but gets different check50 results each time without changing a thing in the source code

Can someone please point out what's wrong with my code? from cs50 import get_int def main(): print("Height should be a positive integer between 0 and 23.") # a "do-while" loop to recieve a ...
0
votes
1answer
85 views

mario_error: expected identifier or '('

I'm stuck on the initial part of the Mario pset. I continue to get the same error message: mario.c:6:1: error: expected identifier or '(' { ^ I understand that it has something to do with the curly ...
0
votes
1answer
25 views

Trouble with mario.c using function

When I run the below program, I get the following output. Height: 10 # Height: 15 ## Height: /* Copied from https://www.reddit.com/r/learnprogramming/comments/68hp3e/...