Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Explorer Diamond
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here int lines = 20; int halfLines = (lines / 2); int middleDashes = 1; //counter = w; Console.Write(Dashes(halfLines)); Console.Write("*"); Console.Write(Dashes(halfLines)); Console.WriteLine(); halfLines -= 1; for (int i = 0; i < lines/2; i++ ) { Console.Write(Dashes(halfLines)); Console.Write("*"); Console.Write(Dashes(middleDashes)); Console.Write("*"); middleDashes += 2; Console.Write(Dashes(halfLines)); Console.WriteLine(); halfLines -= 1; } //halfLines = 0; middleDashes -= 4; halfLines += 2; for (int i = 0; i < (lines/2 - 1); i++ ) { Console.Write(Dashes(halfLines)); Console.Write("*"); Console.Write(Dashes(middleDashes)); Console.Write("*"); middleDashes -= 2; Console.Write(Dashes(halfLines)); Console.WriteLine(); halfLines += 1; } halfLines = lines/2; Console.Write(Dashes(halfLines)); Console.Write("*"); Console.Write(Dashes(halfLines)); Console.WriteLine(); } static string Stars(int n) { return new String('*', n); } static string Dashes(int n) { return new String('-', n); } } }
run
|
edit
|
history
|
help
0
Pos and Neg
Enumeration
generics one more doubt-stack overflow exception
CommandForce1
Added Carnival, List Matching
hello
Ruben
GeneGenerator
IF... ELSE
Rextester