<style type="text/css"> .stWord { font-family: Times New Roman; font-size : 14pt; width : 25pt; } .stExp { font-family: Times New Roman; font-size : 14pt; } </style> <table align="center" cellspacing="5" width="500"> <tbody> <tr> <td class="colorborder"> поиск шифра "3 буквы"<hr> <table width="350" align="center"><tr><td> <input class="stWord" id="ver3Wordinput0" type="text" value="" /> <input class="stWord" id="ver3Wordinput1" type="text" value="" /> <input class="stWord" id="ver3Wordinput2" type="text" value="" /> </td></tr> </table> <div><input onclick="ver3startWrd();" type="button" value="старт" /> <input onclick="ver3Edit1Click();" type="button" value="перебор" /> <input onclick="ver3Edit2Click();" type="button" value="случайный" /></div> <hr> <div>1 результат:<span id="ver3hintrez1">0</span> итераций пароль: <span id="ver3hintparol1">-</span></div> <div>2 результат:<span id="ver3hintrez2">0</span> итераций пароль: <span id="ver3hintparol2">-</span></div> </td> </tr> </tbody> </table> <script> function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min)) + min; } var tablewords = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '!', '@', '#', '$', '%', '^', '&', '*', '-', '_', '=', '+']; </script> <script> function ver3startWrd() { document.getElementById('ver3Wordinput0').value = tablewords[getRandomInt(0, tablewords.length)]; document.getElementById('ver3Wordinput1').value = tablewords[getRandomInt(0, tablewords.length)]; document.getElementById('ver3Wordinput2').value = tablewords[getRandomInt(0, tablewords.length)]; } function ver3Edit1Click() { if (document.getElementById('ver3Wordinput0').value != '') if (document.getElementById('ver3Wordinput0').value != ' ') if (document.getElementById('ver3Wordinput1').value != '') if (document.getElementById('ver3Wordinput1').value != ' ') if (document.getElementById('ver3Wordinput2').value != '') if (document.getElementById('ver3Wordinput2').value != ' ') { var ver3colvoiter = 0; for (var i = 0; i < tablewords.length; i++) for (var j = 0; j < tablewords.length; j++) for (var k = 0; k < tablewords.length; k++) { ver3colvoiter ++; if ((document.getElementById('ver3Wordinput0').value[0] === tablewords[i])&& (document.getElementById('ver3Wordinput1').value[0] === tablewords[j])&& (document.getElementById('ver3Wordinput2').value[0] === tablewords[k])) { document.getElementById('ver3hintrez1').innerHTML = ver3colvoiter; document.getElementById('ver3hintparol1').innerHTML = "" + tablewords[i] + tablewords[j] + tablewords[k]; i = tablewords.length; j = tablewords.length; k = tablewords.length; } } } } function ver3Edit2Click() { var ver3flagno = true; var ver3flagNum = 0; if (document.getElementById('ver3Wordinput0').value != '') if (document.getElementById('ver3Wordinput0').value != ' ') if (document.getElementById('ver3Wordinput1').value != '') if (document.getElementById('ver3Wordinput1').value != ' ') if (document.getElementById('ver3Wordinput2').value != '') if (document.getElementById('ver3Wordinput2').value != ' ') { while ( ver3flagno && (ver3flagNum < 100000000)) { ver3flagNum ++; if ((document.getElementById('ver3Wordinput0').value[0] === tablewords[getRandomInt(0, tablewords.length)])&& (document.getElementById('ver3Wordinput1').value[0] === tablewords[getRandomInt(0, tablewords.length)])&& (document.getElementById('ver3Wordinput2').value[0] === tablewords[getRandomInt(0, tablewords.length)])) { document.getElementById('ver3hintrez2').innerHTML = ver3flagNum; document.getElementById('ver3hintparol2').innerHTML = "" + document.getElementById('ver3Wordinput0').value[0] + document.getElementById('ver3Wordinput1').value[0] + document.getElementById('ver3Wordinput2').value[0]; ver3flagno = false; } } } } </script>