Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace LessonTre
- {
- public class Pixels
- {
- public static void Ex1()
- {
- RedPixel(10);
- BluePixel(5);
- BlackPixel(5);
- YellowPixel(15);
- Console.ReadLine();
- }
- public static void Ex2()
- {
- for (int i = 0; i < 11; i++)
- {
- BluePixel(30);
- YellowPixel(20);
- BluePixel(70);
- }
- for (int i = 0; i < 8; i++)
- {
- YellowPixel(120);
- }
- for (int i = 0; i < 11; i++)
- {
- BluePixel(30);
- YellowPixel(20);
- BluePixel(70);
- }
- Console.ReadLine();
- }
- static void YellowPixel(int x = 1)
- {
- for (int i = 0; i < x; i++)
- {
- Console.BackgroundColor
- = ConsoleColor.Yellow;
- Console.Write(" ");
- }
- }
- static void BluePixel(int x = 1)
- {
- for (int i = 0; i < x; i++)
- {
- Console.BackgroundColor
- = ConsoleColor.Blue;
- Console.Write(" ");
- }
- }
- static void RedPixel(int x = 1)
- {
- for (int i = 0; i < x; i++)
- {
- Console.BackgroundColor
- = ConsoleColor.Red;
- Console.Write(" ");
- }
- }
- static void BlackPixel(int x = 1)
- {
- for (int i = 0; i < x; i++)
- {
- Console.BackgroundColor
- = ConsoleColor.Black;
- Console.Write(" ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement