Last active
October 17, 2019 20:03
-
-
Save nbervar21/36e25645d7d2565e4ce67fb89cab1cd5 to your computer and use it in GitHub Desktop.
cs50 oneline mario
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// mario.c by Nick Bervar (2019) | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int c, char *v[]) | |
{ | |
for (int i = 1, s = c > 1 ? atoi(v[1]) : 6, g = c > 2 ? atoi(v[2]) : 2; i <= s; i++) | |
{ | |
for (int j = 1, m = g + (s * 2); j <= m + 1; j += (printf(j < m + 1 ? ((j <= s - i || j > s + g + i || (j > s && j <= s + g)) ? " " : "#") : "\n") * 0) + 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment