• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

having problem getting the spaces right.  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


 
author
Posts: 23811
140
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, let me fixed the formatting of the topic for you ... which BTW, isn't it ironic that a topic about formatting is not formatted? ...

DONE... at least for the Java code. The ranch doesn't use a fixed width font for code (which is also the tag being used for the diamond), so it will be difficult to show the desired result for the diamond... but we kinda know what you mean.

Henry
 
Marshal
Posts: 5633
147
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags (← that's a link) when posting your program. I'll do it for you this time. (Edit: or I'll let Henry do it.)
 
Knute Snortum
Marshal
Posts: 5633
147
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, there's a problem here, do you see it?

 
Knute Snortum
Marshal
Posts: 5633
147
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, write down how you want to the diamond to look and count the spaces before the stars. I've made an attempt here; you may want to change it.


Next, modify your program (or start over) so that it produces this output. Notice regularities in the spaces and stars.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Below will fix the format issue:

 
Marshal
Posts: 62227
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Unfortunately we do not believe that providing a complete answer helps the original poster to learn. Please look at what it says on the contents page for this forum:-

We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.

Please don't be annoyed but I have pulled rank and shall delete your solution. Our forum software caches the original version in case it is ever needed again.
 
Always! Wait. Never. Shut up. Look at this tiny ad.
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!