Hi, I had a simple question. I just needed to write a code to display the following pattern. I know it is easy, but the thing is, I am an absolute beginner (just started using java less than a week ago). So please don't laugh if its too easy. Here's the pattern:
The code I wrote is:
But this code displays the pattern wrongly, I don't know how I should change it to show the right thing
The code is a Groovy code (a new programming language, probably haven't heard of it, we just started doing this for the first time in uni). It's very similar to Java, in fact it's all based on java, with some added facilities. But even if you give me a psuedocode it would help.
Groovy is a scripting language -- and it goes into the object orient scripting forum.... not here. Anyway....
I won't give you the answer, as this is a homework problem. But here is a hint...
Keep in mind that there are spaces too (Just because you can't see them, doesn't mean that they don't exist). You need to modify the program to print both the "*" and the spaces on each line. If you just print the "*", you will be left justified.