import mm.display.MainWindow;
import mm.structures.ColorField;
import mm.structures.ColorPixel;

import java.awt.*;

public class Main {

    public static void main(String[] args) {
        ColorPixel[] colors = new ColorPixel[]{
                new ColorPixel(new Color(124, 7, 142)),
                new ColorPixel(new Color(236, 74, 72)),
                new ColorPixel(new Color(255, 252, 88)),
                new ColorPixel(new Color(31, 162, 209)),
//                new ColorPixel(new Color(128, 207, 12)),
//                new ColorPixel(new Color(71, 34, 69)),
//                new ColorPixel(new Color(1, 153, 138)),
//                new ColorPixel(new Color(206, 23, 54)),
//                new ColorPixel(new Color(247, 88, 48)),
//                new ColorPixel(new Color(12, 8, 65))
        };

        long start = System.nanoTime();
        ColorField cf = ColorField.GenerateField(50, colors);
        System.out.printf("generiranje polja: %d\n", System.nanoTime() - start);

        MainWindow window = new MainWindow(cf);

        long allStart = System.nanoTime();
        long iterations = 0;
        while(!cf.isAllSame()) {
            cf = cf.updateNeighbours();
            window.updateField(cf);
            iterations++;
        }
        long end = System.nanoTime() - allStart;
        System.out.printf("St iteracij: %d\n", iterations);
        System.out.printf("Celoten cas: %d\n", end);
    }
}

@@ -172,24 +172,53 @@
 g%5B%5D args) %7B%0A
+%0A        final int N = 100;%0A%0A
         Colo
@@ -475,26 +475,24 @@
 162, 209)),%0A
-//
             
@@ -532,26 +532,24 @@
  207, 12)),%0A
-//
             
@@ -587,26 +587,24 @@
 , 34, 69)),%0A
-//
             
@@ -643,26 +643,24 @@
 153, 138)),%0A
-//
             
@@ -699,26 +699,24 @@
 , 23, 54)),%0A
-//
             
@@ -763,10 +763,8 @@
 )),%0A
-//
     
@@ -917,10 +917,9 @@
 eld(
-50
+N
 , co
@@ -969,25 +969,43 @@
 je polja
-: %25d%5Cn%22, 
+ %25d x %25d: %25.3fs%5Cn%22, N, N, (
 System.n
@@ -1022,16 +1022,23 @@
 - start)
+ / 1e9)
 ;%0A%0A     

use all colors, constant for size of field