Questions tagged [pyramid]
The pyramid tag has no usage guidance.
24
questions
0
votes
2
answers
24
views
PSET 1 - Mario Less - Missing one last thing
I am missing one thing in the code because it's printing me the dots in every height case.. Can anyone give me a hint how to solve that ?
int main(void)
{
int n;
do
{
n = get_int("Height: &...
0
votes
1
answer
14
views
Timed out and Pattern changes
I have two issues with my program.
When I command check50 I have "timed out while waiting for program to exit" in different lines of my program. I've already searched for an answer to solve ...
0
votes
1
answer
152
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 ...
1
vote
1
answer
131
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 ...
0
votes
1
answer
43
views
How do I make the pyramid in mario.c less render normally?
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int n;
do
{
n = get_int ("Height: ");
}
while (n < 1 || n > 8);
for (int i = 0; i < n; i++)
{
for (int j = (i - ...
0
votes
1
answer
151
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>
...
1
vote
1
answer
851
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
1
answer
251
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
1
answer
128
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
1
answer
125
views
cs50 mario.c more check errors
I could not find the solution for my error on cs50 mario.c/more as my output shows perfectly fine on the terminal but i get check error which I don't understand please help:
:( handles a height of 1 ...
0
votes
1
answer
197
views
pset1 mario pyramid printing upside down
Hey guys so I've been struggling with how to go about getting my pyramid to print rightside up. So far I've only been able to get it to print with the base on the first row. Any help would be ...
0
votes
1
answer
90
views
Mario printing out backwards
Hello I am new to coding in c and not very familiar with it. I am getting the hash tags and I am using a - so I can see my spacing. Right now I am printing my pyramid the wrong way any help will be ...
0
votes
1
answer
1k
views
CS50 2017 Problem Set 6 Mario.py For loop
What is wrong with my second For Loop (spaces)? It seems like it only runs one time, according to the first line of the pyramid.
import cs50
while True:
print("Type a number between 0 and 23: ", ...
0
votes
1
answer
191
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 = (...
1
vote
1
answer
766
views
ItsaMario Pset1 pyramid left-aligned
Whenever I execute my code, I get a pyramid that is left-aligned instead of right-aligned. I think it is because my for loop for variable j is wrong and therefore none of the spaces will print. I ...
0
votes
1
answer
825
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 ...
1
vote
1
answer
142
views
Mario.c errors for pset1
do
{
printf("Height: \n");
h = GetInt();
}
while (h < 1 || h > 23);
This is what I've done so far for mario.c and even though the output is similar to the requirements I'm still ...
0
votes
1
answer
171
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
1
answer
305
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
1
answer
386
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
0
answers
129
views
mario.c expected identifier or '(' { and mario help
When I try running the mario program, this is what happens. Also i think i might be doing this wrong, can someone guide me in the right direction?
0
votes
1
answer
753
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>
#...
-1
votes
1
answer
260
views
I need help with pset1 mario. Can't print the pyramid
I can get the users input but i cant print the pyramid. i can only get the spaces on the first line. Plus this is the same part that i got stuck on last year and i am only 13.
0
votes
1
answer
298
views
mario pyramid help
Good morning, I want to ask you a questions, that I really need. Its about the pyramid in Mario. Please look my code
for (int row = 0; row < height; row++)
{ for (int spaces = 0; spaces = row - 1;...