Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void DrawRectangle(int length, int height, int thickness)
- {
- //Converts to an absolute, so incase if a negative number is used, it can still work and doesn't 'brick' the function
- int x = Math.Abs(length);
- int y = Math.Abs(height);
- int t = Math.Abs(thickness);
- for (int i = 0; i < y; i++)
- {
- for (int l = 0; l < x; l++)
- {
- if (i < t || i > y - t - 1 || l < t || l > x - t - 1)
- Console.Write("#");
- else
- Console.Write("=");
- Console.Write(" "); //REMOVE THIS IF WANTED, as it only adds a space so it looks nicer in the final product
- }
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement