Here's one of my attempts at creating the mario.c problem set...it won't compile. Can anyone give me a hint as to where I'm going wrong? (prob more than one error)
I wrote another one that didn't have the separate "blocks(int n)" or "space(int n)" functions, and it would only print the pyramid backwards...
#include <cs50.h>
#include <stdio.h>
#include <string.h>
void say(string s, int n);
void blocks(int n);
void space(int n);
int main(void)
{
printf("Mario, tell me how many levels you want your pyramid to be...0 to 23\n");
int height = get_int();
while (height < 0 || height < 24)
{
printf("no, you dingus, I said 'between 0 and 23\n");
//is this necessary? -> int height = get_int();
}
for (int i = 0; i < height; i++)
{
for (int i = 1; i <= height; i++)
{
space(int n);
}
for (int i = 1; i <= height; i++)
{
blocks(int n);
}
}
}
void space(int n)
{
say(" ", height - n);
}
void blocks(int n)
{
say("#", n + 1);
}
void say(string s, int n)
{
for (int i = 0; i < n; i++)
{
printf("%s", n);
}
}