• Post Reply Bookmark Topic Watch Topic
  • New Topic

having problem getting the spaces right.  RSS feed

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


 
author
Sheriff
Posts: 23295
125
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
 
Sheriff
Posts: 4289
127
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
Sheriff
Posts: 4289
127
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
Sheriff
Posts: 4289
127
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: 56600
172
  • 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!