Witam jestem początkujący w c# potrzebuje pomocy w napisaniu zadania, nie chodzi mi o gotowy kod, bardziej o wskazówki. Zadanie wygląda tak:
na razie udało mi się napisać tą plansze i poruszanie się po niej:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace jakies_zadanie
{
class Program
{
static void Print(char[,] t)
{
for (int i = 0; i < t.GetLength(0); i++)
{
for (int j = 0; j < t.GetLength(1); j++)
{
Console.Write("{0}",t[i,j]);
}
Console.WriteLine();
}
}
public static void Gra(char[,] t)
{
int x = 0;
int y = 0;
Console.SetCursorPosition(x, y);
ConsoleKeyInfo D;
while (true)
{
D = Console.ReadKey();
if (D.Key == ConsoleKey.DownArrow)
{
Console.SetCursorPosition(x, y + 2);
y += 2;
}
if (D.Key == ConsoleKey.UpArrow)
{
Console.SetCursorPosition(x, y - 2);
y -= 2;
}
if (D.Key == ConsoleKey.LeftArrow)
{
Console.SetCursorPosition(x - 2, y);
x -= 2;
}
if (D.Key == ConsoleKey.RightArrow)
{
Console.SetCursorPosition(x + 2, y);
x += 2;
}
//if (D.Key == ConsoleKey.Enter)
//{
//}
}
}
static void Main(string[] args)
{
char[,] OX = {
{' ','|', ' ', '|', ' '},
{'-','+', '-', '+', '-'},
{' ','|', ' ', '|', ' '},
{'-','+', '-', '+', '-'},
{' ','|', ' ', '|', ' '},
};
Print(OX);
Gra(OX);
}
}
}
I dalej po prostu nie wiem głównie chodzi mi o podpunkt 2(a) i 2(b) za wszelkie porady bedę bardzo wdzięczny.