Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void PontozasVizszintes(int[,] a)
- {
- int pontszam = 0;
- int doboz = 1;
- //int hely = 1;
- for(int i = 0; i < 6; i++)
- {
- for(int j = 0; j< 6-1; j++)
- {
- if(a[i,j] == a[i, j+1] )
- {
- doboz++;
- Console.WriteLine(doboz);
- }
- }
- if (doboz == 3) { pontszam += doboz; Console.WriteLine(pontszam); Console.ReadKey() ; }
- else if (doboz == 4) {pontszam += 1 + doboz;Console.WriteLine(pontszam); Console.ReadKey();}
- else if (doboz == 5) { pontszam += 2 + doboz; Console.WriteLine(pontszam); Console.ReadKey(); }
- }
- for (int i = 0; i < a.GetLength(0); i++)
- {
- //for (int s = hely; s < a.GetLength(1)-1; s++)
- do
- {
- do
- {
- for (int j = hely; j < a.GetLength(1) - 1; j++)
- {
- if (a[i, j] == a[i, j + 1])
- {
- doboz++;
- Console.WriteLine(doboz);
- }
- else
- {
- doboz = 1;
- Console.WriteLine(doboz);
- }
- //hely++;
- }
- hely++;
- } while (doboz < 2 || hely < a.GetLength(1) - 1);
- if (doboz == 3) pontszam += doboz;
- else if (doboz == 4) pontszam += 1;
- else if (doboz == 5) pontszam += 1;
- } while (hely < a.GetLength(1) - 1);
- //hely = 0;
- Console.WriteLine("Pontszám: " + pontszam);
- Console.ReadLine();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement