• Post Reply Bookmark Topic Watch Topic
  • New Topic

For-loop help  RSS feed

 
kada kanz
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently trying to print a Diamond using for-loops but I seem to be confusing my self / over-complicating it.

This is what I have so far (http://pastebin.com/Ncgf5yGu).
When I run the code I get (http://gyazo.com/3f87e869f9c609800e558829d1e4a778).


I want to duplicate it on to the other side but I can't seem to be able to figure out a working for-loop to print it out.


Also, is there a faster/efficient method of doing something like this?

 
Paweł Baczyński
Bartender
Posts: 2087
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please, post your code here.
Also, don't post your output in image form. Use [code] or [tt] tag instead. (read this)
 
Mannu Khanna
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do look at the changes carefully and learn how to take benefit from the symmetry
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!