package com.sourcefellows.sideeffects;

public class Beispiel {

    static int[][] data = new int[4][4];
    static {
        data[0][0] = 2;
        data[0][1] = 1;
        data[0][2] = 10;
        data[0][3] = 11;

        data[1][0] = 1;
        data[1][1] = 3;
        data[1][2] = 6;
        data[1][3] = 2;

        data[2][0] = 4;
        data[2][1] = 3;
        data[2][2] = 6;
        data[2][3] = 3;

        data[3][0] = 4;
        data[3][1] = 4;
        data[3][2] = 610;
        data[3][3] = 410;
    }

    public static void main(String[] args) {

        for (int i = 0; i < data.length; i++) {
            if (data[i][0] % 2 == 0) { // Entscheidung 1
                for (int j = 1; j < data[i].length; j++) {
                    if (data[i][j] > 5) { // Entscheidung 2
                        for (int k = 0; k < data.length; k++) {// Verschachtelung 1
                            if (data[k][0] == i + 1) { // Entscheidung 3
                                for (int l = 1; l < data[k].length; l++) { // Verschachtelung 2
                                    if (data[k][l] < 4) { // Entscheidung 4
                                        System.out.println("Data point found: " + data[i][j]);
                                        return; // Beenden der Schleifen
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
