Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
26 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
16 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
46 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
46 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
27 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
44 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
46 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
2answers
86 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
42 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
24 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
42 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
73 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
130 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
28 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
39 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
56 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
75 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
44 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
119 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
37 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
29 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
87 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
28 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
145 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
28 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
60 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
1
vote
2answers
115 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
37 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
26 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
37 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
65 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
42 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
76 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
17 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
46 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
40 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
50 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
34 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
49 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
20 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/...
0
votes
2answers
105 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
102 views

CS50 Mario less hashtags printing in reverse order

so I have absolutely no experience with coding. I've been trying to solve the mario less exercise from week 1 on CS50 but my hashtags keep printing in reverse order, so I get an inverted pyramid. I've ...
0
votes
1answer
217 views

Mario Half Pyramid - CS50

I have searched the forum for an answer to my question but the code from others confused me. My pyramid keeps printing upside down and I'm not really sure why. I am not looking for an answer but ...
0
votes
1answer
17 views

pset1- mario (less) error: expected expression

less.c:11:15: error: expected expression while (n < = 0 || n > 23); ^ 1 error generated. make: *** [less] Error 1 Please help! I keep getting this error when attempting to ...
0
votes
1answer
118 views

pset 1 - mario (less) no output

I've typed make less in the terminal but nothing happens. Here's my code: #include <stdio.h> #include <cs50.h> int main(void) { // Ask user for height int height; do { ...
0
votes
1answer
134 views

PSET 1: Mario help (Drawing pyramid)

Stuck on Pset 1 - drawing the pyramid (prompting the user for a number between 0 and 23 working fine). When I try to execute this program, it goes crazy- is there something wrong with my for loops? ...
0
votes
1answer
60 views

i've tried for a week to compile this. cs50 mario.c please help

#include <stdio.h> #include <cs50.h> int main (void) { int n = get_int("Height: "); for (int i = 1; 1 < n; i++) printf("#\n"); }
1
vote
1answer
80 views

pset6 mario/more fails one check50 test despite getting correct output

My code passes all tests of check50 running check50 cs50/2018/x/sentimental/mario/more except this one: rejects a height of 24, and then accepts a height of 2 expected " # #\n## ##\n", not "" ...
0
votes
2answers
504 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 ...