public void update() {
        for (int j = 22; j > 5; j--) {
            for (int i = 2; i < 12; i++) {
                if (!form.field[i][j]) {
                    int l = -1;
                    int type;
                    sequence();
                    do {
                        l++;
                        if (l == 19) l = 0;
                        type = formType[l];
                        form.whatAForm(type, i, j);
                    } while (!form.isEmpty(type) || (lastType == type && type != 6));
                    lastType = type;
                    /*if (type == 6) {
                        for (int ij = 0; ij < formType.length; ij++){
                            System.out.print(formType[ij] + " ");
                        }
                        System.out.println();
                    }*/
                    sum(type);
                    form.fieldTrue();
                    form.formsOnField[formsOnFieldNumb] = new Form(i, j, type);
                    formsOnFieldNumb++;
                    //sequence();
                }
            }
        }
        lastForms();
        if (error) newStart();
        else {
            System.out.println("T " + a + "\nГ " + b + "\nZ " + c + "\nКвадрат " + d + "\nПалка " + e + "\nSum " + sumFields);
            paintComponent(getGraphics());
        }
    }