Created
January 21, 2024 17:52
Fire In The Matrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace TelerikExamples { | |
class FireInTheMatrix { | |
static void Main() { | |
int fireWidth = int.Parse(Console.ReadLine()); | |
int sideDots = (fireWidth - 2) / 2; | |
int middleDots = 0; | |
for (int i = sideDots; i >= 0; i--) { | |
Console.Write(new string('.', i)); | |
Console.Write(new string('#', 1)); | |
Console.Write(new string('.', middleDots)); | |
Console.Write(new string('#', 1)); | |
Console.Write(new string('.', i)); | |
Console.WriteLine(); | |
middleDots += 2; | |
} | |
middleDots = fireWidth - 2; | |
for (int i = 0; i < fireWidth / 4; i++) { | |
Console.Write(new string('.', i)); | |
Console.Write(new string('#', 1)); | |
Console.Write(new string('.', middleDots)); | |
Console.Write(new string('#', 1)); | |
Console.Write(new string('.', i)); | |
Console.WriteLine(); | |
middleDots -= 2; | |
} | |
Console.WriteLine(new string('-', fireWidth)); | |
int middleSlashes = fireWidth / 2; | |
for (int i = 0; i < fireWidth / 2; i++) { | |
Console.Write(new string('.', i)); | |
Console.Write(new string('\\', middleSlashes)); | |
Console.Write(new string('/', middleSlashes)); | |
Console.Write(new string('.', i)); | |
Console.WriteLine(); | |
middleSlashes--; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment