Friday, August 9, 2019

Membuat Bentuk Ketupat C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bentuk_Segitiga
{
    class Program
    {
        static void Main(string[] args)
        {         
            Console.SetCursorPosition(5, 0);
            Console.BackgroundColor = ConsoleColor.Yellow;
            Console.Write(" ");
            Console.SetCursorPosition(4, 1);
            Console.BackgroundColor = ConsoleColor.Yellow;
            Console.Write(" ");
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.Write("{0}", new string(' ', 1));
            Console.BackgroundColor = ConsoleColor.Yellow;
            Console.Write(" ");
            Console.SetCursorPosition(3, 2);
            Console.BackgroundColor = ConsoleColor.Yellow;
            Console.Write(" ");
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.Write("{0}", new string(' ', 3));
            Console.BackgroundColor = ConsoleColor.Yellow;
            Console.Write(" ");
            Console.SetCursorPosition(2, 3);
            Console.BackgroundColor = ConsoleColor.Yellow;
            Console.Write(" ");
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.Write("{0}", new string(' ', 5));
            Console.BackgroundColor = ConsoleColor.Yellow;
            Console.Write(" ");
            Console.SetCursorPosition(1, 4);
            Console.BackgroundColor = ConsoleColor.Yellow;
            Console.Write(" ");
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.Write("{0}", new string(' ', 7));
            Console.BackgroundColor = ConsoleColor.Yellow;
            Console.Write(" ");
            Console.SetCursorPosition(0, 5);
            Console.BackgroundColor = ConsoleColor.Yellow;
            Console.Write(" ");
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.Write("{0}",new string(' ',9));
            Console.BackgroundColor = ConsoleColor.Yellow;
            Console.Write(" ");
            Console.SetCursorPosition(0, 6);
            Console.BackgroundColor = ConsoleColor.Yellow;
            Console.Write("{0}",new string(' ',11));   
            Console.ReadKey();
        }
    }
}



1 comment: