Click here to Skip to main content
15,915,703 members
Home / Discussions / C#
   

C#

 
AnswerRe: Reflection for Class Pin
Pete O'Hanlon14-May-20 1:33
mvePete O'Hanlon14-May-20 1:33 
GeneralRe: Reflection for Class Pin
Oscar K.14-May-20 2:01
Oscar K.14-May-20 2:01 
GeneralRe: Reflection for Class Pin
Eddy Vluggen14-May-20 2:43
professionalEddy Vluggen14-May-20 2:43 
GeneralRe: Reflection for Class Pin
Richard Deeming14-May-20 2:46
mveRichard Deeming14-May-20 2:46 
GeneralRe: Reflection for Class Pin
Oscar K.14-May-20 4:33
Oscar K.14-May-20 4:33 
QuestionIs there a way to implement radio button in property grid Pin
Member 1482116713-May-20 1:33
Member 1482116713-May-20 1:33 
GeneralRe: Is there a way to implement radio button in property grid Pin
harold aptroot13-May-20 2:14
harold aptroot13-May-20 2:14 
AnswerRe: Is there a way to implement radio button in property grid Pin
Eddy Vluggen13-May-20 10:19
professionalEddy Vluggen13-May-20 10:19 
QuestionWeb and Environment Variables Pin
ormonds12-May-20 20:07
ormonds12-May-20 20:07 
AnswerRe: Web and Environment Variables Pin
Richard MacCutchan12-May-20 21:22
mveRichard MacCutchan12-May-20 21:22 
AnswerRe: Web and Environment Variables Pin
Richard Deeming13-May-20 0:17
mveRichard Deeming13-May-20 0:17 
AnswerRe: Web and Environment Variables Pin
Dave Kreskowiak13-May-20 6:44
mveDave Kreskowiak13-May-20 6:44 
Questioncan any one help me and write this code please Pin
Member 1483029312-May-20 13:52
Member 1483029312-May-20 13:52 
AnswerRe: can any one help me and write this code please Pin
Pete O'Hanlon12-May-20 20:53
mvePete O'Hanlon12-May-20 20:53 
AnswerRe: can any one help me and write this code please Pin
Richard MacCutchan12-May-20 21:35
mveRichard MacCutchan12-May-20 21:35 
AnswerRe: can any one help me and write this code please Pin
Dave Kreskowiak13-May-20 6:42
mveDave Kreskowiak13-May-20 6:42 
AnswerRe: can any one help me and write this code please Pin
#realJSOP15-May-20 1:57
professional#realJSOP15-May-20 1:57 
QuestionMake a simple shape/pattern Pin
M.S.S.E10-May-20 10:36
M.S.S.E10-May-20 10:36 
AnswerRe: Make a simple shape/pattern Pin
Eddy Vluggen10-May-20 10:55
professionalEddy Vluggen10-May-20 10:55 
C#
try
{
	Console.WriteLine("#-#-#-#-#");
	Console.WriteLine(" #-#-#-# ");
	Console.WriteLine("  #-#-#  ");
	Console.WriteLine("   #-#   ");
	Console.WriteLine("    #    ");
	Console.ReadLine();
}
catch (Exception ex)
{
	Console.WriteLine(Convert.ToString(ex));
}
You might be tempted to leave out the spaces at the end of the string, but then the pattern is incomplete. All lines should be of equal length, otherwise there is no symmetry. It also needs exception-handling, so I included that in the example. A simple and naive example, I admit, but it works and the output will be technically correct based on your question.

A more complex variation might be done by counting the amount of #. Each line has one fewer # than the previous one, with the - just being filler until you reach the correct amount of #. I'd image that requires some form of loop, counting, and creating a string based on that count.

M.S.S.E wrote:
thanks in advance.
No problem, glad I could help Thumbs Up | :thumbsup:
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

GeneralRe: Make a simple shape/pattern Pin
M.S.S.E10-May-20 11:42
M.S.S.E10-May-20 11:42 
AnswerMessage Closed Pin
10-May-20 20:09
M.S.S.E10-May-20 20:09 
GeneralRe: Make a simple shape/pattern Pin
kalberts10-May-20 20:55
kalberts10-May-20 20:55 
GeneralRe: Make a simple shape/pattern Pin
Pete O'Hanlon10-May-20 21:10
mvePete O'Hanlon10-May-20 21:10 
AnswerRe: Make a simple shape/pattern Pin
Richard MacCutchan10-May-20 21:27
mveRichard MacCutchan10-May-20 21:27 
GeneralRe: Make a simple shape/pattern Pin
M.S.S.E10-May-20 21:37
M.S.S.E10-May-20 21:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.