אדם לאדם זאב: הבדלים בין גרסאות בדף
תוכן שנמחק תוכן שנוסף
מ שוחזר מעריכות של 212.179.174.233 (שיחה) לעריכה האחרונה של 94rain תגית: שחזור |
אין תקציר עריכה |
||
שורה 1:
bool win = false;
char[,] loah = new char[3, 3];
for (int i = 0; i < loah.GetLength(0); i++)
{
for (int j = 0; j < loah.GetLength(1); j++)
{
loah[i, j] = '@';
}
}
while (win == false)
{
}
}
public static bool IsEmpty(char[,] loah, int row, int line)
{
for (int i = 0; i < loah.GetLength(0); i++)
{
for (int j = 0; j < loah.GetLength(1); j++)
{
if (loah[row, line] == '@')
return false;
}
}
return true;
}
public static bool Win(char[,] loah)
{
int sum = 0;
Console.WriteLine("X plays now");
Console.WriteLine("choose the line");
int line = int.Parse(Console.ReadLine());
Console.WriteLine("choose row");
int row = int.Parse(Console.ReadLine());
if (IsEmpty(loah, line, row) == false)
{
Console.WriteLine("This is Full");
while (IsEmpty(loah, line, row) == false)
{
Console.WriteLine("choose the line");
line = int.Parse(Console.ReadLine());
Console.WriteLine("choose row");
row = int.Parse(Console.ReadLine());
if (IsEmpty(loah, line, row) == true)
Console.WriteLine("You've done your turn");
}
}
if (sora(loah) || amoda(loah) || alhson(loah))
{
return true;
Console.WriteLine("X won");
}
Console.WriteLine("O plays now");
Console.WriteLine("choose the line");
line = int.Parse(Console.ReadLine());
Console.WriteLine("choose row");
row = int.Parse(Console.ReadLine());
if (IsEmpty(loah, line, row) == false)
{
Console.WriteLine("This is Full");
while (IsEmpty(loah, line, row) == false)
{
Console.WriteLine("choose the line");
line = int.Parse(Console.ReadLine());
Console.WriteLine("choose row");
row = int.Parse(Console.ReadLine());
if (IsEmpty(loah, line, row) == true)
Console.WriteLine("You've done your turn");
}
}
return false;
}
|