Puzzle R15

Print an N by N square of random dots and stars

[M-8] Write a program that generates and prints N lines of N characters. The characters are randomly chosen dots and stars. Make about 1 character out of 13 a star. Typical output is:

*..............*.......*
*.........*.............
...........*...**.......
........................
.*.........*............
...........*............
............*..*........
..............**.....*..
...*....................
.....*..................
.......................*
.............*..........
.........*....*.........
............*...........
........*.*.......*....*
..................*.....
..................*.....
......**...........*....
......*.......*....*....
......*......*..........
..............*.....*...
.......................*
..*..*..................
....*...................


Previous Page        Answer         Next Page         Home