0
HTMLそうが回転した文字列
に文字、数字、記号をコンパイルしようと、私は、任意の桁数のすべての組み合わせを表示する数字を変更繰り返しにconsole.logを持ってしようとしています。 文字列内の各文字を使用するために、使用する数字を定義し、文字配列 "console.log(s [0])"を使用する関数を作成しようとする一連の変数を作成しました。しかし、コードを実行しようとするたびに、bをコンソールに一度記録して停止します。 コード:
function start()
{
var inputDigit = document.getElementById("inputDigit").value;
var lowerCaseAlpabet = "abcdefghijklmnopqrstuvwxyz";
var upperCaseAlpabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var symbols = "*&^%$#@!()<>?/.,|}{][-_=+~`"
var Numbers = "1234567890"
var all = lowerCaseAlpabet+upperCaseAlpabet+symbols+Numbers
console.log(all)
var allLength = all.length - 1
var digit = 0
digit1(all,allLength,digit)
function digit1(all,allLength,zero){
if (digit < allLength) {
var finalValue = all[digit]
var digit = digit + 1
return finalValue
}
return finalValue
var digit = digit + 1
console.log(finalValue)
digit1(all,allLength,digit)
}
}
コード全体のドキュメント:
<!DOCTYPE html>
\t \t \t \t <html>
\t \t \t \t <head>
\t \t \t \t <!--<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>-->
\t \t \t \t <title>Passcode Compiler</title>
\t \t \t \t <h1>Welcome to the Passcode Compiler</h1>
\t \t \t \t <h2>Please fill in the blank below with the amount of digits that you need</h2>
\t \t \t \t </head>
\t \t \t \t <body>
\t \t \t \t <script>
\t \t \t \t </script>
\t \t \t \t <br> <input type="text" id="inputDigit">compiling length</input><br><!--This takes the year input-->
\t \t \t \t <button onclick="start()">Submit</button><br><!--This submits the input values above to the javascript code below-->
\t \t \t \t <script>
\t \t \t \t function start()
\t \t \t \t {
\t \t \t \t var inputDigit = document.getElementById("inputDigit").value;
\t \t \t \t var lowerCaseAlpabet = "abcdefghijklmnopqrstuvwxyz";
\t \t \t \t var upperCaseAlpabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
\t \t \t \t var symbols = "*&^%$#@!()<>?/.,|}{][-_=+~`"
\t \t \t \t var Numbers = "1234567890"
\t \t \t \t var all = lowerCaseAlpabet+upperCaseAlpabet+symbols+Numbers
\t \t \t \t console.log(all)
\t \t \t \t var allLength = all.length - 1
\t \t \t \t var digit = 0
\t \t \t \t digit1(all,allLength,digit)
\t \t \t \t function digit1(all,allLength,zero){
\t \t \t \t if (digit < allLength) {
\t \t \t \t var finalValue = all[digit]
\t \t \t \t var digit = digit + 1
\t \t \t \t return finalValue
\t \t \t \t }
\t \t \t \t return finalValue
\t \t \t \t var digit = digit + 1
\t \t \t \t console.log(finalValue)
\t \t \t \t digit1(all,allLength,digit)
\t \t \t \t }
\t \t \t \t }
\t \t \t \t </script>
\t \t \t \t <h4>
\t \t \t \t </h4> \t
\t \t \t \t </body>
\t \t \t \t </html>
\t \t \t \t </!doctype>
\t \t \t \t <!--setTimeout(function(){/*YourCode*/},1000);