Hello,
I would like to print out a square, but the part that has got me stuck is that it has to be dynamic, depending on user input. Also, the square has to be made of 'o' characters.
So, say for instance that the user gets to choose a number between 2-10 and selects 5, a square has to be printed that is 5 'o' 's wide and 5 'o' 's long. The inner square is made of dots:
ooooo
o . . . o
o . . . o
o . . . o
ooooo
I also have to do this in a pyramid, say for example that the user selects 5 again then it has to look like this(including the .'s):
....o....
...ooo...
..ooooo..
.ooooooo.
ooooooooo
Here I noticed the pattern that the dots always start with input -1 and the o's increment by +2 each line. But I don't know how to implement this.
Could someone tell me the syntax how to pull this off in CL? I'm writing a script which I compile and call to execute it.
I would like to print out a square, but the part that has got me stuck is that it has to be dynamic, depending on user input. Also, the square has to be made of 'o' characters.
So, say for instance that the user gets to choose a number between 2-10 and selects 5, a square has to be printed that is 5 'o' 's wide and 5 'o' 's long. The inner square is made of dots:
ooooo
o . . . o
o . . . o
o . . . o
ooooo
I also have to do this in a pyramid, say for example that the user selects 5 again then it has to look like this(including the .'s):
....o....
...ooo...
..ooooo..
.ooooooo.
ooooooooo
Here I noticed the pattern that the dots always start with input -1 and the o's increment by +2 each line. But I don't know how to implement this.
Could someone tell me the syntax how to pull this off in CL? I'm writing a script which I compile and call to execute it.
Comment