function render() {

  leftimg = Think.all[randomNumber(0, Think.all.length - 1)];
  rightimg = Think.all[randomNumber(0, Think.all.length - 1)];
  centerimg = Think.all[randomNumber(0, Think.all.length - 1)];
  while ((leftimg === centerimg) || (leftimg === rightimg) || (centerimg === rightimg)) {

    render();
  }
  console.log(Prev.includes(leftimg))

  while (Prev.includes(leftimg)) {
    console.log("it`s agine left")
    check();

    leftimg = Think.all[randomNumber(0, Think.all.length - 1)];
          while((leftimg === centerimg) || (leftimg === rightimg) ||(centerimg === rightimg)  )
    {
      render();
    }
    check();
  }


  console.log(Prev.includes(rightimg))
  while (Prev.includes(rightimg)) {
    check();

    rightimg = Think.all[randomNumber(0, Think.all.length - 1)];
    console.log("it`s agine right");
    while ((leftimg === centerimg) || (leftimg === rightimg) || (centerimg === rightimg)) {
      render();
    }
    check();
  }
  console.log(Prev.includes(centerimg))

  while (Prev.includes(centerimg)) {
    check();

    centerimg = Think.all[randomNumber(0, Think.all.length - 1)];
    console.log("it`s center agine")
    while ((leftimg === centerimg) || (leftimg === rightimg) || (centerimg === rightimg)) {
      render();
    }
    check();
  }
  Prev.push(leftimg);
  Prev.push(rightimg);
  Prev.push(centerimg);
  while (Prev.length > 3) {
    Prev.shift();
  }

  leftImage.setAttribute('src', leftimg.imagePath);
  leftImage.setAttribute('alt', (leftimg.name.split(".", 1)));
  leftImage.setAttribute('title', (leftimg.name.split(".", 1)));
  rightImage.setAttribute('src', rightimg.imagePath);
  rightImage.setAttribute('alt', (rightimg.imagePath.split(".", 1)));
  rightImage.setAttribute('title', (rightimg.imagePath.split(".", 1)));
  centerImage.setAttribute('src', centerimg.imagePath);
  centerImage.setAttribute('alt', (centerimg.imagePath.split(".", 1)));
  centerImage.setAttribute('title', (centerimg.imagePath.split(".", 1)));
}
//genrating the output and make sure that their is no imgs are the same and even shown agine in the next ittertion 
genrating the output and make sure that their is no imgs are the same and even shown agine in the next ittertion
genrating the output and make sure that their is no imgs are the same and even shown agine in the next ittertion
function render() {
  leftimg = Think.all[randomNumber(0, Think.all.length - 1)];
  rightimg = Think.all[randomNumber(0, Think.all.length - 1)];
  centerimg = Think.all[randomNumber(0, Think.all.length - 1)];
  while ((leftimg === centerimg) || (leftimg === rightimg) || (centerimg === rightimg)) {
    render();
  }
  console.log(Prev.includes(leftimg))
  while (Prev.includes(leftimg)) {
    console.log("it`s agine left")
    check();
    leftimg = Think.all[randomNumber(0, Think.all.length - 1)];
          while((leftimg === centerimg) || (leftimg === rightimg) ||(centerimg === rightimg)  )
    {
      render();
    }
    check();
  }
  console.log(Prev.includes(rightimg))
  while (Prev.includes(rightimg)) {
    check();
    rightimg = Think.all[randomNumber(0, Think.all.length - 1)];
    console.log("it`s agine right");
    while ((leftimg === centerimg) || (leftimg === rightimg) || (centerimg === rightimg)) {
      render();
    }
    check();
  }
  console.log(Prev.includes(centerimg))
  while (Prev.includes(centerimg)) {
    check();
    centerimg = Think.all[randomNumber(0, Think.all.length - 1)];
    console.log("it`s center agine")
    while ((leftimg === centerimg) || (leftimg === rightimg) || (centerimg === rightimg)) {
      render();
    }
    check();
  }
  Prev.push(leftimg);
  Prev.push(rightimg);
  Prev.push(centerimg);
  while (Prev.length > 3) {
    Prev.shift();
  }
  leftImage.setAttribute('src', leftimg.imagePath);
  leftImage.setAttribute('alt', (leftimg.name.split(".", 1)));
  leftImage.setAttribute('title', (leftimg.name.split(".", 1)));
  rightImage.setAttribute('src', rightimg.imagePath);
  rightImage.setAttribute('alt', (rightimg.imagePath.split(".", 1)));
  rightImage.setAttribute('title', (rightimg.imagePath.split(".", 1)));
  centerImage.setAttribute('src', centerimg.imagePath);
  centerImage.setAttribute('alt', (centerimg.imagePath.split(".", 1)));
  centerImage.setAttribute('title', (centerimg.imagePath.split(".", 1)));
}
function render ( ) { leftimg = Think . all [ randomNumber ( 0 , Think . all . length - 1 ) ] ; rightimg = Think . all [ randomNumber ( 0 , Think . all . length - 1 ) ] ; centerimg = Think . all [ randomNumber ( 0 , Think . all . length - 1 ) ] ; while ( ( leftimg === centerimg ) || ( leftimg === rightimg ) || ( centerimg === rightimg ) ) { render ( ) ; } console . log ( Prev . includes ( leftimg ) ) while ( Prev . includes ( leftimg ) ) { console . log ( "it`s agine left" ) check ( ) ; leftimg = Think . all [ randomNumber ( 0 , Think . all . length - 1 ) ] ; while ( ( leftimg === centerimg ) || ( leftimg === rightimg ) || ( centerimg === rightimg ) ) { render ( ) ; } check ( ) ; } console . log ( Prev . includes ( rightimg ) ) while ( Prev . includes ( rightimg ) ) { check ( ) ; rightimg = Think . all [ randomNumber ( 0 , Think . all . length - 1 ) ] ; console . log ( "it`s agine right" ) ; while ( ( leftimg === centerimg ) || ( leftimg === rightimg ) || ( centerimg === rightimg ) ) { render ( ) ; } check ( ) ; } console . log ( Prev . includes ( centerimg ) ) while ( Prev . includes ( centerimg ) ) { check ( ) ; centerimg = Think . all [ randomNumber ( 0 , Think . all . length - 1 ) ] ; console . log ( "it`s center agine" ) while ( ( leftimg === centerimg ) || ( leftimg === rightimg ) || ( centerimg === rightimg ) ) { render ( ) ; } check ( ) ; } Prev . push ( leftimg ) ; Prev . push ( rightimg ) ; Prev . push ( centerimg ) ; while ( Prev . length > 3 ) { Prev . shift ( ) ; } leftImage . setAttribute ( 'src' , leftimg . imagePath ) ; leftImage . setAttribute ( 'alt' , ( leftimg . name . split ( "." , 1 ) ) ) ; leftImage . setAttribute ( 'title' , ( leftimg . name . split ( "." , 1 ) ) ) ; rightImage . setAttribute ( 'src' , rightimg . imagePath ) ; rightImage . setAttribute ( 'alt' , ( rightimg . imagePath . split ( "." , 1 ) ) ) ; rightImage . setAttribute ( 'title' , ( rightimg . imagePath . split ( "." , 1 ) ) ) ; centerImage . setAttribute ( 'src' , centerimg . imagePath ) ; centerImage . setAttribute ( 'alt' , ( centerimg . imagePath . split ( "." , 1 ) ) ) ; centerImage . setAttribute ( 'title' , ( centerimg . imagePath . split ( "." , 1 ) ) ) ; }
genrating the output and make sure that their is no imgs are the same and even shown agine in the next ittertion
genrating the output and make sure that their is no imgs are the same and even shown agine in the next ittertion