Jump to content

hisoka

Members
  • Content count

    497
  • Joined

  • Last visited

Community Reputation

2 Neutral

About hisoka

  • Rank
    Member
  1. hisoka

    find x value in modular equation

    wonderful , thank you very much
  2. hisoka

    find x value in modular equation

    Hello I put this question in general section as it has something to do with math : x modulo 20 = 33 . How to get the value of x ? any help would be appreciated
  3. thank you very much
  4. thanks , I have another question concerning the web console output : As you can see , when I run the above code , the output is many numbers each in a line . Is it possible to get , in the web console , all numbers in the same line ? if yes , could you please tell me how ?
  5. thank you . Could you please suggest me a Mozilla Firefox program that runs JavaScript code , that is easy to use and far more flexible and comfortable than the web console , where I can copy paste the content i need without any problem . May be an ad don that I do not know that is compatible with Firefox 58 . I have Mozilla Firefox 58 and , unfortunately , an add on like , for example , Execute JS is not compatible with my version but with the old versions of Firefox best regards
  6. Thank you for your reply . But , unfortunately , your answer does not meet my question I asked if there is a way or a method to copy only the numbers from the web console without the Scratchpad/4:6:4 and debugger eval code:6:4 . So If there is a way or a method , what is it ? best regards
  7. Here is my problem : for example when I wrote this little piece of code in scratchpad and run it then I got the result in the web console of Mozilla Firefox , var s = "hello w3schools how are you doing"; var m ; for(i=0 ; i <s.length ; i++) { m = s.charCodeAt(i); console.log(m); } I got a result of many numbers . Now when I tried to copy the numbers I got in the web console , it did not let me copy only the numbers but other things so that I could not paste only the numbers but the other things too which are not necessary for me . The same happened when I run the code directly in the web console : The same happened when I run the code directly in the web console : I need only to copy paste the numbers from the web console not with the Scratchpad.... or debugger eval.... Please could you help me by showing me how to do it or whether there is a solution to the problem to copy paste numbers without the unnecessary rest .
  8. hisoka

    understanding javascript code

    what do you mean by that . Could you please make it more simple to understand ?
  9. hisoka

    understanding javascript code

    I have trouble understanding this long javascript code : var p = 0; var r = ''; var b = new Array(); for(var i=0; i<32768; i++) b[i] = 0; function main() { incPtr(1); incVal(10); while(b[p]>0) { decPtr(1); incVal(8); incPtr(1); decVal(1); } decPtr(1); incVal(5); echo(String.fromCharCode(b[p])); incPtr(1); incVal(6); while(b[p]>0) { decPtr(1); incVal(5); incPtr(1); decVal(1); } decPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); incVal(2); while(b[p]>0) { decPtr(1); decVal(7); incPtr(1); decVal(1); } decPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); incVal(3); while(b[p]>0) { decPtr(1); incVal(4); incPtr(1); decVal(1); } decPtr(1); incVal(1); echo(String.fromCharCode(b[p])); decVal(4); echo(String.fromCharCode(b[p])); incPtr(1); incVal(3); while(b[p]>0) { decPtr(1); decVal(4); incPtr(1); decVal(1); } decPtr(1); decVal(1); echo(String.fromCharCode(b[p])); incPtr(1); incVal(3); while(b[p]>0) { decPtr(1); incVal(4); incPtr(1); decVal(1); } decPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); incVal(2); while(b[p]>0) { decPtr(1); decVal(4); incPtr(1); decVal(1); } decPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); incVal(4); while(b[p]>0) { decPtr(1); decVal(10); incPtr(1); decVal(1); } decPtr(1); decVal(3); echo(String.fromCharCode(b[p])); incPtr(1); incVal(4); while(b[p]>0) { decPtr(1); incVal(10); incPtr(1); decVal(1); } decPtr(1); incVal(2); incPtr(2); incVal(10); while(b[p]>0) { decPtr(1); incVal(8); incPtr(1); decVal(1); } decPtr(1); incVal(1); incPtr(2); incVal(10); while(b[p]>0) { decPtr(1); incVal(5); incPtr(1); decVal(1); } decPtr(1); incVal(3); incPtr(2); incVal(10); while(b[p]>0) { decPtr(1); incVal(10); incPtr(1); decVal(1); } decPtr(1); decVal(7); incPtr(2); incVal(11); while(b[p]>0) { decPtr(1); incVal(10); incPtr(1); decVal(1); } decPtr(1); incVal(3); incPtr(1); b[p] = prompt('', '').charCodeAt(0); echo(String.fromCharCode(b[p])); incVal(2); incPtr(1); b[p] = prompt('', '').charCodeAt(0); echo(String.fromCharCode(b[p])); incPtr(1); b[p] = prompt('', '').charCodeAt(0); echo(String.fromCharCode(b[p])); incPtr(1); b[p] = prompt('', '').charCodeAt(0); echo(String.fromCharCode(b[p])); decVal(4); incPtr(1); b[p] = prompt('', '').charCodeAt(0); echo(String.fromCharCode(b[p])); incPtr(3); incVal(8); while(b[p]>0) { decPtr(1); incVal(4); incPtr(1); decVal(1); } decPtr(1); incPtr(2); incVal(10); while(b[p]>0) { decPtr(1); incVal(9); incPtr(1); decVal(1); } decPtr(1); decVal(3); incPtr(2); incVal(11); while(b[p]>0) { decPtr(1); incVal(10); incPtr(1); decVal(1); } decPtr(1); incVal(4); incPtr(2); incVal(11); while(b[p]>0) { decPtr(1); incVal(10); incPtr(1); decVal(1); } decPtr(1); incVal(1); incPtr(2); incVal(11); while(b[p]>0) { decPtr(1); incVal(10); incPtr(1); decVal(1); } decPtr(1); incPtr(2); incVal(10); while(b[p]>0) { decPtr(1); incVal(10); incPtr(1); decVal(1); } decPtr(1); incVal(3); incPtr(2); incVal(6); while(b[p]>0) { decPtr(1); incVal(5); incPtr(1); decVal(1); } decPtr(1); incVal(3); incPtr(1); incVal(1); incPtr(2); incVal(8); while(b[p]>0) { decPtr(1); incVal(4); incPtr(1); decVal(1); } decPtr(1); incPtr(2); incVal(10); while(b[p]>0) { decPtr(1); incVal(7); incPtr(1); decVal(1); } decPtr(1); decVal(3); incPtr(2); incVal(11); while(b[p]>0) { decPtr(1); incVal(10); incPtr(1); decVal(1); } decPtr(1); incVal(1); incPtr(2); incVal(11); while(b[p]>0) { decPtr(1); incVal(10); incPtr(1); decVal(1); } decPtr(1); incVal(4); incPtr(2); incVal(11); while(b[p]>0) { decPtr(1); incVal(10); incPtr(1); decVal(1); } decPtr(1); incVal(4); incPtr(2); incVal(10); while(b[p]>0) { decPtr(1); incVal(10); incPtr(1); decVal(1); } decPtr(1); incVal(1); incPtr(2); incVal(10); while(b[p]>0) { decPtr(1); incVal(10); incPtr(1); decVal(1); } decPtr(1); decVal(1); incPtr(2); incVal(11); while(b[p]>0) { decPtr(1); incVal(10); incPtr(1); decVal(1); } decPtr(1); incVal(6); incPtr(2); incVal(6); while(b[p]>0) { decPtr(1); incVal(5); incPtr(1); decVal(1); } decPtr(1); incVal(3); decPtr(22); while(b[p]>0) { decPtr(5); decVal(1); incPtr(5); decVal(1); } decPtr(5); while(b[p]>0) { incPtr(10); incVal(1); decPtr(10); while(b[p]>0) { decVal(1); } } incPtr(6); decVal(1); while(b[p]>0) { decPtr(5); decVal(1); incPtr(5); decVal(1); } decPtr(5); while(b[p]>0) { incPtr(9); incVal(1); decPtr(9); while(b[p]>0) { decVal(1); } } incPtr(6); incVal(2); while(b[p]>0) { decPtr(5); decVal(1); incPtr(5); decVal(1); } decPtr(5); while(b[p]>0) { incPtr(8); incVal(1); decPtr(8); while(b[p]>0) { decVal(1); } } incPtr(6); while(b[p]>0) { decPtr(5); decVal(1); incPtr(5); decVal(1); } decPtr(5); while(b[p]>0) { incPtr(7); incVal(1); decPtr(7); while(b[p]>0) { decVal(1); } } incPtr(6); incVal(5); while(b[p]>0) { decPtr(5); decVal(1); incPtr(5); decVal(1); } decPtr(5); while(b[p]>0) { incPtr(6); incVal(1); decPtr(6); while(b[p]>0) { decVal(1); } } incPtr(6); while(b[p]>0) { incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); decVal(1); decPtr(8); while(b[p]>0) { decVal(1); } } incPtr(8); while(b[p]>0) { incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); incPtr(1); echo(String.fromCharCode(b[p])); decPtr(9); while(b[p]>0) { decVal(1); } } } function incPtr(n) { if(p < 32676 - n) p += n; else p = 0; } function decPtr(n) { if(p > n - 1) p -= n; else p = 255; } function incVal(n) { if(b[p] < 255 - n) b[p] += n; else b[p] = 0; } function decVal(n) { if(b[p] > n - 1) b[p] -= n; else b[p] = 255; } function echo(c) { r += c; } var isWS = (typeof(alert)=='undefined'); if(isWS) prompt = function() {WScript.Echo("Unable to run this program.\n'prompt' is not supported under Windows Script Host!");return "";}; main(); if(r!='') if(isWS) WScript.Echo(r); else alert(r); is it obfuscated ? if yes how to get the original code ? so that i could understand what it does any idea?
  10. hisoka

    javascript code does not show result

    Now I am trying to take a number as input in box and once I press ok all the primes that are less than it are generated I did like this : function calculate(x) { var x = prompt("enter a number"); var results = "" ; var y=parseInt(x); for(i=0 ; i<n ; i++) { var isprime = false; for(j=2 ; j<n ; j++) { if(i%j===0 && i!==j) { isprime = true; } } if(isprime===false) { results += i + "\n"; } } return results; } console.log(calculate(x)); but it gives no result . I know that something I added in the code is wrong but I do not know how to correct it .
  11. hisoka

    javascript code does not show result

    I changed that code with another code : function calculate(n) { for(i=0 ; i<=n ; i++) { var isprime = false; for(j=2 ; j<=n ; j++) { if(i%j===0 && i!==j) { isprime = true; } } if(isprime===false) { console.log(i+"\n"); } } } console.log(calculate(17)); then it gives me : 1 2 3 5 7 11 13 17 undefined I do not know why get undefined and how to correct the code so that I do not get undefined
  12. hisoka

    javascript code does not show result

    That is why I put the code here and asked for help because I do not know how that function will return a value , how it will print it in the computer screen so that I can see it . What to do so that the function is well written and how to do it !! Generally I know that an integer is a prime if it is not divisible by any prime less or equal to its square root hence we have in that code the var q = Math.floor(Math.sqrt( n)); it gives the square root of a number combined with math.floor and the for loop it takes n % i which is n % all numbers that are less or equal to the square root of n and dismisses or ignore all the numbers that are divisible by n as they are not prime . Moreover the role of the function is not to look if n is a prime or not otherwise to give all the primes between 2 and n My problem is I cannot make it print the values . You wrote that is it not well written , it does not return a value ....... I know all that . So what do you suggest to make it well writeen , return a value and print it in the screen . What is the substitution ? any suggest from you on what to do ?
  13. I have this javascript code and when I run it it does not print the result : function isprime(n) { if (n<2) { return false; } var q = Math.floor(Math.sqrt( n)); for( i = 2 ; i<= q ; i++) { var result = n%i; if(result==0) { return false; } else { document.write(result); } } } var prime = isprime(100); I do not know why ? any help on what is the problem is and how to solve it
  14. That is it thank you . Sorry , I did not read the comments . Next time I will read the comments too and look al all possible corners of the page Yes I realise . However if the computer begins to calculate from 0 not from 1 like humans so why the output here : var array = [1, 2, 3] ; var x = array.length ; console.log(x) ; is 3 and not 2 ?
  15. Normally , the second parameter passed to the function is 3 not 2 because the size of [1,2,3] is 3 not 2 . I know it is 3 through this : var array = [1, 2, 3] ; var x = array.length ; console.log(x) ; the output is 3 not 2 and 2 exponent 3 is 8 not 4
×