|
|
@ -174,7 +174,8 @@ function ShowMainForm() |
|
|
|
} |
|
|
|
axis_y=Math.floor((current_position /rows)); |
|
|
|
pawn_x=board_headerx[current_board]+(axis_x*col_width)+(col_width-pawn_width[current_board])/2; |
|
|
|
pawn_y=board_footery[current_board]+pawn_height[current_board]+(axis_y*col_height)+(col_height-pawn_height[current_board])/2; |
|
|
|
pawn_y=board_footery[current_board]+pawn_height[current_board]+(axis_y*col_height); |
|
|
|
pawn_y += (col_height-pawn_height[current_board])/2; |
|
|
|
|
|
|
|
document.write('<div id="pawn1"><img id="pawn" alt="" src="images/player1.png"></div>'); |
|
|
|
move_pawn(); |
|
|
@ -252,12 +253,14 @@ function check_answer_M() { |
|
|
|
current_position += current_dice; |
|
|
|
correct_ans =correct_ans+1; //calculate new score---- |
|
|
|
score = Math.round((correct_ans/all_ans)*100); |
|
|
|
document.getElementById("show_score").innerHTML='<strong>'+str_score+': </strong><strong class="score">' +score+ '</strong>'; |
|
|
|
var s = '<strong>'+str_score+': </strong><strong class="score">' +score+ '</strong>'; |
|
|
|
document.getElementById("show_score").innerHTML = s; |
|
|
|
check_game_over(); |
|
|
|
check_exists_ladder(); |
|
|
|
} else { |
|
|
|
score = Math.round((correct_ans/all_ans)*100); |
|
|
|
document.getElementById("show_score").innerHTML='<strong>'+str_score+': </strong><strong class="score">' +score+ '</strong>'; |
|
|
|
var s = '<strong>'+str_score+': </strong><strong class="score">' +score+ '</strong>'; |
|
|
|
document.getElementById("show_score").innerHTML = s; |
|
|
|
check_exists_snake(); |
|
|
|
} |
|
|
|
|
|
|
@ -273,13 +276,15 @@ function check_answer_S() { |
|
|
|
current_position += current_dice; |
|
|
|
correct_ans =correct_ans+1; //calculate new score |
|
|
|
score = Math.round((correct_ans/all_ans)*100); |
|
|
|
document.getElementById("show_score").innerHTML='<strong>'+str_score+': </strong><strong class="score">' +score+ '</strong>'; |
|
|
|
var s = '<strong>'+str_score+': </strong><strong class="score">' +score+ '</strong>'; |
|
|
|
document.getElementById("show_score").innerHTML = s; |
|
|
|
check_game_over(); |
|
|
|
check_exists_ladder(); |
|
|
|
} else { |
|
|
|
document.getElementById("feedb_wrong").style.display = "block"; |
|
|
|
score = Math.round((correct_ans/all_ans)*100); |
|
|
|
document.getElementById("show_score").innerHTML='<strong>'+str_score+': </strong><strong class="score">' +score+ '</strong>'; |
|
|
|
var s = '<strong>'+str_score+': </strong><strong class="score">' +score+ '</strong>'; |
|
|
|
document.getElementById("show_score").innerHTML = s; |
|
|
|
check_exists_snake(); |
|
|
|
} |
|
|
|
|
|
|
@ -438,7 +443,8 @@ function move_pawn() { |
|
|
|
|
|
|
|
axis_y=Math.floor((current_position /rows)); |
|
|
|
pawn_x=board_headerx[current_board]+(axis_x*col_width)+(col_width-pawn_width[current_board])/2; |
|
|
|
pawn_y=board_footery[current_board]+pawn_height[current_board]+(axis_y*col_height)+(col_height-pawn_height[current_board])/2; |
|
|
|
pawn_y = board_footery[current_board]+pawn_height[current_board]+(axis_y*col_height); |
|
|
|
pawn_y += (col_height-pawn_height[current_board])/2; |
|
|
|
|
|
|
|
document.getElementById("pawn1").style.position='relative'; |
|
|
|
document.getElementById("pawn1").style.left=pawn_x+'px'; |
|
|
@ -456,7 +462,6 @@ function move_pawn() { |
|
|
|
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); |
|
|
|
|
|
|
|
while (i < input.length) { |
|
|
|
|
|
|
|
enc1 = keyStr.indexOf(input.charAt(i++)); |
|
|
|
enc2 = keyStr.indexOf(input.charAt(i++)); |
|
|
|
enc3 = keyStr.indexOf(input.charAt(i++)); |
|
|
@ -489,30 +494,25 @@ function move_pawn() { |
|
|
|
var c = c1 = c2 = 0; |
|
|
|
|
|
|
|
while ( i < utftext.length ) { |
|
|
|
|
|
|
|
c = utftext.charCodeAt(i); |
|
|
|
|
|
|
|
if (c < 128) { |
|
|
|
string += String.fromCharCode(c); |
|
|
|
i++; |
|
|
|
} |
|
|
|
else if((c > 191) && (c < 224)) { |
|
|
|
} else if((c > 191) && (c < 224)) { |
|
|
|
c2 = utftext.charCodeAt(i+1); |
|
|
|
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); |
|
|
|
i += 2; |
|
|
|
} |
|
|
|
else { |
|
|
|
} else { |
|
|
|
c2 = utftext.charCodeAt(i+1); |
|
|
|
c3 = utftext.charCodeAt(i+2); |
|
|
|
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); |
|
|
|
i += 3; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return string; |
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
</body> |
|
|
|