Advertisement
Archon

starfield

Nov 25th, 2010
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main(){
  6.    int i, j, numSpaces;
  7.    srand(time(0));
  8.    for (i = 0; i != 20; ++i){
  9.       numSpaces = rand() % 19;
  10.      
  11.       //print
  12.       for (j = 0; j != numSpaces; ++j)
  13.          printf(" ");
  14.       printf("*\n");
  15.  
  16.    }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement