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 Tasks
- {
- class Program
- {
- static void Main(string[] args)
- {
- Painter painter = new Painter();
- painter.PaintGamer();
- }
- }
- class Gamer
- {
- public int Xposition { get; private set; }
- public int Yposition { get; private set; }
- public Gamer(int x, int y)
- {
- Xposition = x;
- Yposition = y;
- }
- }
- class Painter
- {
- private Gamer gamer = new Gamer(6, 6);
- public void PaintGamer(char playerChar1 = 'O', char playerChar2 = '*', char playerChar3 = '_')
- {
- int XpositionForRendering = gamer.Xposition;
- int YpositionForRendering = gamer.Yposition;
- Console.SetCursorPosition(XpositionForRendering, YpositionForRendering);
- Console.Write(playerChar1);
- Console.SetCursorPosition(XpositionForRendering + 2, YpositionForRendering);
- Console.Write(playerChar1);
- Console.SetCursorPosition(XpositionForRendering + 1, YpositionForRendering + 1);
- Console.Write(playerChar2);
- Console.SetCursorPosition(XpositionForRendering, YpositionForRendering + 2);
- Console.Write(playerChar3);
- Console.SetCursorPosition(XpositionForRendering + 1, YpositionForRendering + 2);
- Console.Write(playerChar3);
- Console.SetCursorPosition(XpositionForRendering + 2, YpositionForRendering + 2);
- Console.Write(playerChar3);
- Console.CursorVisible = false;
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment