Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal class Program
- {
- static string[] plansza;
- const char GRACZ = '^';
- const char PRZESZKODA = '#';
- private static void Main(string[] args)
- {
- // kolumna 0 - lewa, 1- środek , 2 prawa
- int pozycjaGracza = 1;
- NowaGra(10);
- UstawGracza(pozycjaGracza);
- WyswietlPlansze();
- }
- private static void NowaGra(int iloscWierszy)
- {
- plansza = new string[iloscWierszy];
- for (int i = 0; i < plansza.Length; i++)
- {
- plansza[i] = "";
- }
- }
- private static void UstawGracza(int pozycjaGracza)
- {
- string linia = " ";
- linia = linia.Insert(pozycjaGracza, GRACZ.ToString());
- plansza[plansza.Length - 1] = linia;
- }
- private static void WyswietlPlansze()
- {
- Console.Clear();
- for (int i = 0; i < plansza.Length; i++)
- {
- System.Console.WriteLine(plansza[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement