Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Cube3D
- {
- class Program
- {
- static void Main(string[] args)
- {
- int depth = 5;
- int width = 10;
- int height = 15;
- var maxLines = height+depth;
- var maxColumn = width + depth;
- var tempDepth = depth;
- var tempDepth2 = depth;
- for (int line = 0; line < maxLines; line++)
- {
- if (tempDepth > 0 && line == 0)
- {
- Console.Write(new String(' ', tempDepth));
- Console.Write(new String('*', width));
- }
- else if (tempDepth > 0 && line != 0)
- {
- Console.Write(new String(' ', tempDepth));
- Console.Write('*');
- Console.Write(new String(' ', width - 2));
- Console.Write('*');
- var diff = depth - tempDepth;
- if (diff > 1)
- {
- Console.Write(new String(' ', diff - 1));
- }
- Console.Write('*');
- }
- else if (tempDepth == 0 && line == depth)
- {
- Console.Write(new String('*', width));
- Console.Write(new String(' ', depth - 1));
- Console.Write('*');
- }
- else if (tempDepth == 0 && line < maxLines-depth-1)
- {
- Console.Write('*');
- Console.Write(new String(' ', width-2));
- Console.Write('*');
- Console.Write(new String(' ', depth - 1));
- Console.Write('*');
- }
- else if (tempDepth == 0 && line >= maxLines - depth-1 && tempDepth2 != 0)
- {
- Console.Write('*');
- Console.Write(new String(' ', width - 2));
- Console.Write('*');
- Console.Write(new String(' ', tempDepth2-1));
- Console.Write('*');
- tempDepth2--;
- }
- else if (tempDepth == 0 && tempDepth2 == 0)
- {
- Console.Write(new String('*',width));
- }
- if (tempDepth > 0)
- {
- tempDepth--;
- }
- Console.WriteLine();
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement