Syntax error even though there is none

My console says there is a synthax error even though i am pretty sure there is none…

void mousePressed () {
Variante = int ( random (1,6));
}

Hello @iinnessic

Did you try?

int variante = int(random(1,6));

:nerd_face:

I just did, doesnt change anything… :frowning:

Please let us see several lines of code that immediately precede the ones that you posted.

The line i posted is in a separate tab of the following sketch:

// Gloable Variablen

// Button QUiz starten
int rectColor = #BECBDB;

// Farbe REechtecke A, B und C
boolean ButtonA = false;
boolean ButtonB = false;
boolean ButtonC = false;
int rectA;
int rectB;
int rectC;
int rectEnter;

int newSiteColor; // “neues” Fenster
int textColor; // Schriftfarbe
int bkColor; // hintergrundfarbe

// Bilder
PImage img1;
PImage img2;
PImage img3;

// wichtig für random funkton
boolean Bild1A = false;
boolean Bild1B = false;
boolean Bild1C = false;
boolean Bild2A = false;
boolean Bild2B = false;
boolean Bild2C = false;
boolean Bild3A = false;
boolean Bild3B = false;
boolean Bild3C = false;

// wichtig für Random Funktion
int Variante;

// Helvetica einsetzen
PFont font;

// Enter shortcut

void setup () { 

  size (1000, 800);  
  bkColor = #DAD4CB; 
  background (bkColor);
  font = loadFont("Helvetica.vlw");
} 

void draw () { 

  // QUiz Button
    rectMode(CENTER); 
    fill (rectColor); 
    rect ( 500, 720, 100, 60); 

 
 hoverEffekt();     // hover Effekt 

//__________________________________________ 


 textFunktion();   // Funktionsaufruf 

//____________________________________________
keyPressed(); // Funktionsaufruf
//____________________________________________
mouseClicked (); // Funktionsaufruf
//____________________________________________
mousePressed(); // Funktionsaufruf
//____________________________________________

// Wenn hintergrund weiß ist, dann folgende Code ausführen:
  if (bkColor == #BECBDB){ 


// erstellt eine "neue" Seite   
  newSiteColor = #DAD4CB;    
  fill (newSiteColor); 
  rect(0,0,100000,8000); 

  
// Aufgabenstellung
  textSize(30); 
  fill(0); 
  text("Welche Darstellung entspricht", 500, 150); 
  text("dem Gestaltungsgesetz der Kontinuität?", 500, 190);
  textAlign (CENTER, BOTTOM);     
 



// Bilder laden 

//  ___________________________

  if (Bild1A == true){
    img1 = loadImage("image_01.png");
    image (img1, 100, 300, 200, 200 ); 
  }
  if (Bild1B == true) {
    img1 = loadImage("image_01.png");
  image (img1, 400, 300, 200, 200);
  }
  if (Bild1C == true) {
    img1 = loadImage("image_01.png");
   image (img1, 700, 300, 200, 200);
  }

//  ___________________________

  if (Bild2A == true){
    img2 = loadImage("image_02.png");
    image (img2, 100, 300, 200, 200); 
  }
  if (Bild2B == true){
    img2 = loadImage("image_02.png");
     image (img2, 400, 300, 200, 200);
  }
  if (Bild2C == true){
    img2 = loadImage("image_02.png");
  image (img2, 700, 300, 200, 200);
  }
  
  //  ________________________
  
  if (Bild3A == true) {
    img3 = loadImage("image_03.png");
  image (img3, 100, 300, 200, 200 ); 
  }
  if (Bild3B == true) {
    img3 = loadImage("image_03.png");
 image (img3, 400, 300, 200, 200); 
  }
  if (Bild3C == true) {
    img3 = loadImage("image_03.png");
   image (img3, 700, 300, 200, 200); 
  }
  
  
  // ______________
  
  if (Variante == 1) {
    Bild1A = true;
    Bild1B = false; 
    Bild1C = false;
    
    Bild2A = false;
    Bild2B = true;
    Bild2C = false;
    
    Bild3A = false;
    Bild3B = false;
    Bild3C = true;
  }
  
  if (Variante == 2) {
    Bild1A = false;
    Bild1B = true;
    Bild1C = false;
    
    Bild2A = false;
    Bild2B = false;
    Bild2C = true;
    
    Bild3A = true;
    Bild3B = false;
    Bild3C = false;
    
  }
  
  if (Variante == 3){
    Bild1A = false;
    Bild1B = false;
    Bild1C = true;
    
    Bild2A = true;
    Bild2B = false;
    Bild3C = false;
    
    Bild3A = false;
    Bild3B = true;
    Bild3C = false;
    
  }
  
  if (Variante == 4) {
    Bild1A = true;
    Bild1B = false;
    Bild1C = false;
    
    Bild2A = false;
    Bild2B = false;
    Bild2C = true;
    
    Bild3A = false;
    Bild3B = true;
    Bild3C = false;
    
  }
  
  if (Variante == 5) {
    Bild1A = false;
    Bild1B = true;
    Bild1C = false;
    
    Bild2A = true;
    Bild2B = false;
    Bild2C = false;
    
    Bild3A = false;
    Bild3B = false;
    Bild3C = true;
    
  }
  
  if (Variante == 6) {
    Bild1A = false;
    Bild1B = false;
    Bild1C = true;
    
    Bild2A = false;
    Bild2B = true;
    Bild2C = false;
    
    Bild3A = true;
    Bild3B = false;
    Bild3C = false;
    
  }
  
  // Abfrage ob richtig angeklickt 
  
  if (Variante == 1 && mousePressed && mouseX > 500 && mouseX <550 && mouseY>550 && mouseY<600) { //B
    text("richtig!", 500, 300);
  } 
  
  /*
  else if (Variante == 2 &&  mouseClicked && mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580){
    text("richtig!", 500, 300);
    }
    else if (Variante == 3 && mousePressed && mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580 ) {
      text("richtig!", 500, 300);
    } 
    else if ( Variante == 4 && mousePressed && mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580 ) {
      text("richtig!", 500, 300);
    } 
    else if (Variante == 5 && mousePressed && mouseX > 450 && mouseX <550 && mouseY>520 && mouseY<580){ //A
    text("richtig!", 500, 300);
    } 
    else if ( Variante == 6 && mousePressed && mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580){
    text("richtig!", 500, 300);
    }
    */
      
    
    
  
 // ____________________________________
 
// rechtecke für Auswahlmöglichkeiten   
  fill (rectColor);
  fill (rectA);
  rect ( 200, 550, 50, 50); 
  textColor = 0;          
  fill(textColor);
   text("A", 200, 570); 
  
  fill (rectB);
  rect ( 500, 550, 50, 50); 
  textColor = 0;          
  fill(textColor);
   text("B", 500, 570); 

  fill (rectC);
  rect ( 800, 550, 50, 50); 
      textColor = 0;          
  fill(textColor);
   text("C", 800, 570); 
  
 //Rechteck für Enter
 keyPressed();

// hover quiz auswahl enter

   /*  && mousePressed && mouseX > 450 && mouseX <550 && mouseY>520 && mouseY<580 
    &&  mousePressed && mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580
    && mousePressed && mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580 
    && mousePressed && mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580
    && mousePressed && mouseX > 450 && mouseX <550 && mouseY>520 && mouseY<580
    && mousePressed && mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580) */
  // _____________________________
  
  hoverEffekt();
  
  // _____________________________
  
  mouseClicked ();
  
   
   

} 

}

you don’t need to call those.

They are called automatically.

this runs:


// Gloable Variablen

// Button QUiz starten
int rectColor = #BECBDB;

// Farbe REechtecke A, B und C
boolean ButtonA = false;
boolean ButtonB = false;
boolean ButtonC = false;
int rectA;
int rectB;
int rectC;
int rectEnter;

int newSiteColor; // “neues” Fenster
int textColor; // Schriftfarbe
int bkColor; // hintergrundfarbe

// Bilder
PImage img1;
PImage img2;
PImage img3;

// wichtig für random funkton
boolean Bild1A = false;
boolean Bild1B = false;
boolean Bild1C = false;
boolean Bild2A = false;
boolean Bild2B = false;
boolean Bild2C = false;
boolean Bild3A = false;
boolean Bild3B = false;
boolean Bild3C = false;

// wichtig für Random Funktion
int Variante;

// Helvetica einsetzen
PFont font;

// Enter shortcut

void setup () { 

  size (1000, 800);  
  bkColor = #DAD4CB; 
  background (bkColor);
  font = createFont("Helvetica.vlw", 14);
} 

void draw () { 

  // QUiz Button
  rectMode(CENTER); 
  fill (rectColor); 
  rect ( 500, 720, 100, 60); 


  //hoverEffekt();     // hover Effekt 

  //__________________________________________ 


  // textFunktion();   // Funktionsaufruf 

  //____________________________________________
  //  keyPressed(); // Funktionsaufruf
  //____________________________________________
  //  mouseClicked (); // Funktionsaufruf
  //____________________________________________
  //  mousePressed(); // Funktionsaufruf
  //____________________________________________

  // Wenn hintergrund weiß ist, dann folgende Code ausführen:
  if (bkColor == #BECBDB) { 


    // erstellt eine "neue" Seite   
    newSiteColor = #DAD4CB;    
    fill (newSiteColor); 
    rect(0, 0, 100000, 8000); 


    // Aufgabenstellung
    textSize(30); 
    fill(0); 
    text("Welche Darstellung entspricht", 500, 150); 
    text("dem Gestaltungsgesetz der Kontinuität?", 500, 190);
    textAlign (CENTER, BOTTOM);     




    // Bilder laden 

    //  ___________________________

    if (Bild1A == true) {
      img1 = loadImage("image_01.png");
      image (img1, 100, 300, 200, 200 );
    }
    if (Bild1B == true) {
      img1 = loadImage("image_01.png");
      image (img1, 400, 300, 200, 200);
    }
    if (Bild1C == true) {
      img1 = loadImage("image_01.png");
      image (img1, 700, 300, 200, 200);
    }

    //  ___________________________

    if (Bild2A == true) {
      img2 = loadImage("image_02.png");
      image (img2, 100, 300, 200, 200);
    }
    if (Bild2B == true) {
      img2 = loadImage("image_02.png");
      image (img2, 400, 300, 200, 200);
    }
    if (Bild2C == true) {
      img2 = loadImage("image_02.png");
      image (img2, 700, 300, 200, 200);
    }

    //  ________________________

    if (Bild3A == true) {
      img3 = loadImage("image_03.png");
      image (img3, 100, 300, 200, 200 );
    }
    if (Bild3B == true) {
      img3 = loadImage("image_03.png");
      image (img3, 400, 300, 200, 200);
    }
    if (Bild3C == true) {
      img3 = loadImage("image_03.png");
      image (img3, 700, 300, 200, 200);
    }


    // ______________

    if (Variante == 1) {
      Bild1A = true;
      Bild1B = false; 
      Bild1C = false;

      Bild2A = false;
      Bild2B = true;
      Bild2C = false;

      Bild3A = false;
      Bild3B = false;
      Bild3C = true;
    }

    if (Variante == 2) {
      Bild1A = false;
      Bild1B = true;
      Bild1C = false;

      Bild2A = false;
      Bild2B = false;
      Bild2C = true;

      Bild3A = true;
      Bild3B = false;
      Bild3C = false;
    }

    if (Variante == 3) {
      Bild1A = false;
      Bild1B = false;
      Bild1C = true;

      Bild2A = true;
      Bild2B = false;
      Bild3C = false;

      Bild3A = false;
      Bild3B = true;
      Bild3C = false;
    }

    if (Variante == 4) {
      Bild1A = true;
      Bild1B = false;
      Bild1C = false;

      Bild2A = false;
      Bild2B = false;
      Bild2C = true;

      Bild3A = false;
      Bild3B = true;
      Bild3C = false;
    }

    if (Variante == 5) {
      Bild1A = false;
      Bild1B = true;
      Bild1C = false;

      Bild2A = true;
      Bild2B = false;
      Bild2C = false;

      Bild3A = false;
      Bild3B = false;
      Bild3C = true;
    }

    if (Variante == 6) {
      Bild1A = false;
      Bild1B = false;
      Bild1C = true;

      Bild2A = false;
      Bild2B = true;
      Bild2C = false;

      Bild3A = true;
      Bild3B = false;
      Bild3C = false;
    }

    // Abfrage ob richtig angeklickt 

    if (Variante == 1 && mousePressed && mouseX > 500 && mouseX <550 && mouseY>550 && mouseY<600) { //B
      text("richtig!", 500, 300);
    } 

    /*
  else if (Variante == 2 &&  mouseClicked && mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580){
     text("richtig!", 500, 300);
     }
     else if (Variante == 3 && mousePressed && mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580 ) {
     text("richtig!", 500, 300);
     } 
     else if ( Variante == 4 && mousePressed && mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580 ) {
     text("richtig!", 500, 300);
     } 
     else if (Variante == 5 && mousePressed && mouseX > 450 && mouseX <550 && mouseY>520 && mouseY<580){ //A
     text("richtig!", 500, 300);
     } 
     else if ( Variante == 6 && mousePressed && mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580){
     text("richtig!", 500, 300);
     }
     */




    // ____________________________________

    // rechtecke für Auswahlmöglichkeiten   
    fill (rectColor);
    fill (rectA);
    rect ( 200, 550, 50, 50); 
    textColor = 0;          
    fill(textColor);
    text("A", 200, 570); 

    fill (rectB);
    rect ( 500, 550, 50, 50); 
    textColor = 0;          
    fill(textColor);
    text("B", 500, 570); 

    fill (rectC);
    rect ( 800, 550, 50, 50); 
    textColor = 0;          
    fill(textColor);
    text("C", 800, 570); 

    //Rechteck für Enter
    //   keyPressed();

    // hover quiz auswahl enter

    /*  && mousePressed && mouseX > 450 && mouseX <550 && mouseY>520 && mouseY<580 
     &&  mousePressed && mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580
     && mousePressed && mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580 
     && mousePressed && mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580
     && mousePressed && mouseX > 450 && mouseX <550 && mouseY>520 && mouseY<580
     && mousePressed && mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580) */
    // _____________________________

    //hoverEffekt();

    // _____________________________

    //mouseClicked ();
  }
}

void mousePressed () {
  Variante = int ( random (1, 6));
}

It still doesnt… I tried

maybe the error is somewhere else

I commented out all keyPressed calls and mousePressed and so on

Please copy and paste the error message so we can see it exactly as is. Also, is the mousePressed() function that you posted in a file all by itself? If there is any code that precedes it, the problem might be there. For example, a syntax error might be the result of a parenthesis that was not closed prior to a function definition or other block of code that does not belong inside parentheses.

That’s the message:
Syntaxfehler - Missing operator, semicolon, or ‘}’ near ‘mousePressed’?

And the mousePressed() function is in a tab all by itself.
I searched for errors in the other tabs and couldn’t find it…

this runs with all tabs



// Gloable Variablen

// Button QUiz starten
int rectColor = #BECBDB;

// Farbe REechtecke A, B und C
boolean ButtonA = false;
boolean ButtonB = false;
boolean ButtonC = false;
int rectA;
int rectB;
int rectC;
int rectEnter;

int newSiteColor; // “neues” Fenster
int textColor; // Schriftfarbe
int bkColor; // hintergrundfarbe

// Bilder
PImage img1;
PImage img2;
PImage img3;

// wichtig für random funkton
boolean Bild1A = false;
boolean Bild1B = false;
boolean Bild1C = false;
boolean Bild2A = false;
boolean Bild2B = false;
boolean Bild2C = false;
boolean Bild3A = false;
boolean Bild3B = false;
boolean Bild3C = false;

// wichtig für Random Funktion
int Variante;

// Helvetica einsetzen
PFont font;

// Enter shortcut

void setup () { 

  size (1000, 800);  
  bkColor = #DAD4CB; 
  background (bkColor);
  font = createFont("Helvetica.vlw", 5);
} 

void draw () { 

  // QUiz Button
  rectMode(CENTER); 
  fill (rectColor); 
  rect ( 500, 720, 100, 60); 


  hoverEffekt();     // hover Effekt 

  //__________________________________________ 


  textFunktion();   // Funktionsaufruf 

  //____________________________________________
  keyPressed(); // Funktionsaufruf
  //____________________________________________
  mouseClicked (); // Funktionsaufruf
  //____________________________________________
  mousePressed(); // Funktionsaufruf
  //____________________________________________

  // Wenn hintergrund weiß ist, dann folgende Code ausführen:
  if (bkColor == #BECBDB) { 


    // erstellt eine "neue" Seite   
    newSiteColor = #DAD4CB;    
    fill (newSiteColor); 
    rect(0, 0, 100000, 8000); 


    // Aufgabenstellung
    textSize(30); 
    fill(0); 
    text("Welche Darstellung entspricht", 500, 150); 
    text("dem Gestaltungsgesetz der Kontinuität?", 500, 190);
    textAlign (CENTER, BOTTOM);     




    // Bilder laden 

    //  ___________________________

    if (Bild1A == true) {
      img1 = loadImage("image_01.png");
      image (img1, 100, 300, 200, 200 );
    }
    if (Bild1B == true) {
      img1 = loadImage("image_01.png");
      image (img1, 400, 300, 200, 200);
    }
    if (Bild1C == true) {
      img1 = loadImage("image_01.png");
      image (img1, 700, 300, 200, 200);
    }

    //  ___________________________

    if (Bild2A == true) {
      img2 = loadImage("image_02.png");
      image (img2, 100, 300, 200, 200);
    }
    if (Bild2B == true) {
      img2 = loadImage("image_02.png");
      image (img2, 400, 300, 200, 200);
    }
    if (Bild2C == true) {
      img2 = loadImage("image_02.png");
      image (img2, 700, 300, 200, 200);
    }

    //  ________________________

    if (Bild3A == true) {
      img3 = loadImage("image_03.png");
      image (img3, 100, 300, 200, 200 );
    }
    if (Bild3B == true) {
      img3 = loadImage("image_03.png");
      image (img3, 400, 300, 200, 200);
    }
    if (Bild3C == true) {
      img3 = loadImage("image_03.png");
      image (img3, 700, 300, 200, 200);
    }


    // ______________

    if (Variante == 1) {
      Bild1A = true;
      Bild1B = false; 
      Bild1C = false;

      Bild2A = false;
      Bild2B = true;
      Bild2C = false;

      Bild3A = false;
      Bild3B = false;
      Bild3C = true;
    }

    if (Variante == 2) {
      Bild1A = false;
      Bild1B = true;
      Bild1C = false;

      Bild2A = false;
      Bild2B = false;
      Bild2C = true;

      Bild3A = true;
      Bild3B = false;
      Bild3C = false;
    }

    if (Variante == 3) {
      Bild1A = false;
      Bild1B = false;
      Bild1C = true;

      Bild2A = true;
      Bild2B = false;
      Bild3C = false;

      Bild3A = false;
      Bild3B = true;
      Bild3C = false;
    }

    if (Variante == 4) {
      Bild1A = true;
      Bild1B = false;
      Bild1C = false;

      Bild2A = false;
      Bild2B = false;
      Bild2C = true;

      Bild3A = false;
      Bild3B = true;
      Bild3C = false;
    }

    if (Variante == 5) {
      Bild1A = false;
      Bild1B = true;
      Bild1C = false;

      Bild2A = true;
      Bild2B = false;
      Bild2C = false;

      Bild3A = false;
      Bild3B = false;
      Bild3C = true;
    }

    if (Variante == 6) {
      Bild1A = false;
      Bild1B = false;
      Bild1C = true;

      Bild2A = false;
      Bild2B = true;
      Bild2C = false;

      Bild3A = true;
      Bild3B = false;
      Bild3C = false;
    }

    // Abfrage ob richtig angeklickt 

    if (Variante == 1 && mousePressed && mouseX > 500 && mouseX <550 && mouseY>550 && mouseY<600) { //B
      text("richtig!", 500, 300);
    } 

    /*
  else if (Variante == 2 &&  mouseClicked && mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580){
     text("richtig!", 500, 300);
     }
     else if (Variante == 3 && mousePressed && mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580 ) {
     text("richtig!", 500, 300);
     } 
     else if ( Variante == 4 && mousePressed && mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580 ) {
     text("richtig!", 500, 300);
     } 
     else if (Variante == 5 && mousePressed && mouseX > 450 && mouseX <550 && mouseY>520 && mouseY<580){ //A
     text("richtig!", 500, 300);
     } 
     else if ( Variante == 6 && mousePressed && mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580){
     text("richtig!", 500, 300);
     }
     */




    // ____________________________________

    // rechtecke für Auswahlmöglichkeiten   
    fill (rectColor);
    fill (rectA);
    rect ( 200, 550, 50, 50); 
    textColor = 0;          
    fill(textColor);
    text("A", 200, 570); 

    fill (rectB);
    rect ( 500, 550, 50, 50); 
    textColor = 0;          
    fill(textColor);
    text("B", 500, 570); 

    fill (rectC);
    rect ( 800, 550, 50, 50); 
    textColor = 0;          
    fill(textColor);
    text("C", 800, 570); 

    //Rechteck für Enter
    keyPressed();

    // hover quiz auswahl enter

    /*  && mousePressed && mouseX > 450 && mouseX <550 && mouseY>520 && mouseY<580 
     &&  mousePressed && mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580
     && mousePressed && mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580 
     && mousePressed && mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580
     && mousePressed && mouseX > 450 && mouseX <550 && mouseY>520 && mouseY<580
     && mousePressed && mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580)
     */
    // _____________________________

    hoverEffekt();

    // _____________________________

    mouseClicked ();
  }
}

void mousePressed () {
  Variante = int ( random (1, 6));
}

void hoverEffekt() {

  // hover quiz start
  if (mouseX > 450 && mouseX < 550 && mouseY >690 && mouseY < 780) {    // wenn maus über rechteck ist 
    if (mousePressed) {                                             // wenn auf starten gedrückt wird, dann soll hintergrund weiß werden 
      bkColor =#BECBDB;
    }
    rectColor = #FEFF24; 
    println("maus ist über box");
  } else { // wenn nicht, dann... 
    rectColor = #BECBDB;
  }


  // Hover und Farbveränderung  bei Auswahlmöglichkeiten
  if (mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580) {    // wenn maus über rechteck ist 
    rectA = #FEFF24; //gelb
    println ("maus ist über A");
  } else {
    rectA = #BECBDB;
  }

  // Rechteck A wird Orange beim Klicken 
  if (mousePressed && mouseX > 150 && mouseX < 250 && mouseY >520 && mouseY < 580 ) {    
    rectA = #F5C720 ;
    ButtonA = true; 
    println ("A wird Orange");
  }

  //______________________________


  if (mouseX > 450 && mouseX <550 && mouseY>520 && mouseY<580) {
    rectB = #FEFF24;
    println ("maus ist über B");
  } else {
    rectB = #BECBDB;
  }

  if (mousePressed && mouseX > 450 && mouseX <550 && mouseY>520 && mouseY<580) {
    rectB = #F5C720;
    println ("B wird Orange");
  }


  // ____________________________


  if (mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580 ) {
    rectC = #FEFF24;
    println ("maus ist über C");
  } else {
    rectC = #BECBDB;
  }

  if (mousePressed && mouseX > 750 && mouseX< 850 && mouseY>520 && mouseY<580 ) {
    rectC = #F5C720;
    println ("C wird Orange");
  }

  // ______________________________

  // Hover und Farbveränderung  bei Enter

  if (mouseX > 450 && mouseX <550 && mouseY>520 && mouseY<580) {
    rectEnter = #FEFF24;
    println ("maus ist über Enter");
  } else {
    rectEnter = #BECBDB;
  }

  if (mousePressed && mouseX > 450 && mouseX <550 && mouseY>520 && mouseY<580) {
    rectEnter = #F5C720;
    println ("Enter wird Orange");
  }
  // ____________________________________
}

void textFunktion() {
  textColor = 0;

  textFont (font);
  fill (#433D68);
  textSize (70);
  textAlign (CENTER, BOTTOM);
  text ("Gestaltgesetze", 500, 150);
  fill (textColor);
  textSize (40);
  textAlign (CENTER, CENTER);
  text ("Teilaufgabe 1 | WS 22/23", 500, 300);
  text ("Interaktive Werkzeuge | Prof. Ralph Tille", 500, 380);
  textSize (20);
  textAlign (CENTER, CENTER);
  text ("INES KURTOVIC | ik057", 500, 460);
  textSize (40);
  textAlign (CENTER, TOP);
  text ("Kennst du die Gestaltgesetze?", 500, 600);
  fill (0);
  textSize (30);
  textAlign (CENTER, TOP);
  text ("Quiz", 500, 700);
}