Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <script>
- var movex = 95;
- var speedx = 130.5;
- var top1 = 185;
- var movey = 185;
- var speedy = 125.5;
- var duca = 0;
- var movex1 = 75;
- var speedx1 = 132.5;
- var top2 = 197;
- var movey1 = 197;
- var speedy1 = 125.5;
- var duca1 = 0;
- var turn = 1;
- var box = [12];
- for(num = 1; num < 13; num++) { box[num] = 0; }
- var cpic = [5];
- for (d = 1; d < 5; d++) { cpic[d] = 0 }
- start();
- function change(click){
- if ((turn == 1) && (box[click] == 0 )){document.getElementById(click).src = "red.jpg";
- box[click] = 1;
- turn++;
- }
- if ((turn == 2) && (box[click] == 0)) {document.getElementById(click).src = "blue.jpg";
- box[click] = 1;
- turn++;
- }
- if ((box[1] == 1) && (box[3]== 1) && (box[7]==1) && (box[8]==1) && (turn == 2) && (cpic[1] == 0)) {document.getElementById("c1").src = "red_let.jpg";
- cpic[1]= 1;
- turn = 1;
- }
- if ((box[2] == 1) && (box[4]== 1) && (box[8]==1) && (box[9]==1) && (turn == 2) && (cpic[2] == 0)) {document.getElementById("c2").src = "red_let.jpg";
- cpic[2]= 1;
- turn = 1;}
- if ((box[3] == 1) && (box[5]== 1) && (box[10]==1) && (box[11]==1) && (turn == 2) && (cpic[3] == 0)) {document.getElementById("c3").src = "red_let.jpg";
- cpic[3]= 1;
- turn = 1;}
- if ((box[4] == 1) && (box[6]== 1) && (box[11]==1) && (box[12]==1) && (turn == 2) && (cpic[4] == 0)) {document.getElementById("c4").src = "red_let.jpg";
- cpic[4]= 1;
- turn = 1;}
- if ((box[1] == 1) && (box[3]== 1) && (box[7]==1) && (box[8]==1) && (turn == 3) && (cpic[1] == 0)) {document.getElementById("c1").src = "blue_let.jpg";
- cpic[1]= 1;
- turn = 2;}
- if ((box[2] == 1) && (box[4]== 1) && (box[8]==1) && (box[9]==1)&& (turn == 3) && (cpic[2] == 0)) {document.getElementById("c2").src = "blue_let.jpg";
- cpic[2]= 1;
- turn = 2;}
- if ((box[3] == 1) && (box[5]== 1) && (box[10]==1) && (box[11]==1)&& (turn == 3) && (cpic[3] == 0)) {document.getElementById("c3").src = "blue_let.jpg";
- cpic[3]= 1;
- turn = 2;}
- if ((box[4] == 1) && (box[6]== 1) && (box[11]==1) && (box[12]==1)&& (turn == 3) && (cpic[4] == 0)) {document.getElementById("c4").src = "blue_let.jpg";
- cpic[4]= 1;
- turn = 2;}
- if(turn == 3) {turn = 1;}
- }
- function start(){
- document.write('<img src = "grid.jpg" name = "grid" Style = "position:absolute; left:100px ; top:125px " width = 490 height 500>')
- document.write('<img src = "blank.jpg" id = c1 style = "position:absolute;left:220; top: 199" width= 110 height= 100 >')
- document.write('<img src = "blank.jpg" id = c2 style = "position:absolute;left:350; top: 199" width= 110 height= 100 >')
- document.write('<img src = "blank.jpg" id = c3 style = "position:absolute;left:220; top: 325" width= 110 height= 100 >')
- document.write('<img src = "blank.jpg" id = c4 style = "position:absolute;left:350; top: 325" width= 110 height= 100 >')
- for(i=1;i<7;i++)
- {
- if (duca == 2){duca = 0; movex = 95; top1 = movey+=speedy}
- duca++;
- move1 = movex+=speedx;
- document.write('<img src = "trans.jpg" id = '+i+' width = 100.5 height = 10 style = "position:absolute; left:'+move1+'; top:'+top1+'" Onclick="change('+i+')">')
- }
- for(b=7;b<13;b++)
- {
- if (duca1 == 3){duca1 = 0; movex1 = 75; top2 = movey1+=speedy1}
- duca1++;
- move2 = movex1+=speedx1;
- document.write('<img src = "trans.jpg" id = '+b+' width = 10 height = 97 style = "position:absolute; left:'+move2+'; top:'+top2+'" Onclick="change('+b+')">')
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement