Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

"blind" programming [challenge]

Name: Anonymous 2015-04-29 23:33

Here's a stupid idea.

You know things like "print this pattern:

*
***
*****
*******
*********


can be done wiht any dumb challenges like this..

try to solve it by writing the program into this thread - NO TESTING! Then try it out.

Name: Anonymous 2015-04-30 0:46

C, the X version
#include <stdio.h>

// N => 1
#define N 5

int main() {
int i, j;
char s[64], out[2*N] = {0};
for(i = 0; i < 2*N - 1; i++) {
for(j = 0; j < 2; j++) {
sprintf(s, "%%.%ds%%c", i + 2*j*(N - i - 1));
sprintf(out, s, '*');
}
puts(out);
}
return 0;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List