EG Information
Training Missions
Knowledge Bank
Pimp Us Out!
Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.
|
| |
Affiliates
|
|
Enigma Group's Code Bank
Simple Math GameBy: Ultraminor - Date Submitted: 2010-10-10 13:55:08 <html> <head> <title>Mental math trainer</title> <script> var inputElement; var questionElement; var statElement; var flasherElement; var answer; var timeout; function loader() { if(navigator.appName=="Microsoft Internet Explorer") { document.getElementById("body").innerHTML='<p style="font-size:1em">I see you're using Internet Explorer.<br />Unfortunately, this software is not very IE-friendly.<br />Why not try Firefox?</p>'; return 0; } inputElement=document.getElementById("input"); questionElement=document.getElementById("quest"); statElement=document.getElementById("stats"); flasherElement=document.getElementById("flasher"); generateQuestion(); } function generateQuestion() { var num1; var num2; var op=Math.floor(Math.random()*4); switch(op) { case 0: num1=Math.floor(Math.random()*120); num2=Math.floor(Math.random()*120); answer=num1+num2; questionElement.innerHTML=num1.toString()+"+"+num2.toString()+"=?"; break; case 1: num1=Math.floor(Math.random()*120); num2=Math.floor(Math.random()*120); answer=num1*num2; questionElement.innerHTML=num1.toString()+"x"+num2.toString()+"=?"; break; case 2: num1=Math.floor(Math.random()*120); num2=Math.floor(Math.random()*num1); answer=num1-num2; questionElement.innerHTML=num1.toString()+"-"+num2.toString()+"=?"; break; case 3: num2=Math.floor(Math.random()*14)+1; num1=num2*Math.floor(Math.random()*15); answer=num1/num2; questionElement.innerHTML=num1.toString()+"/"+num2.toString()+"=?"; break; } } function handleKeyPress(event) { if(event.keyCode==13) //enter { checkAnswer(); return 0; } if((event.keyCode==8||event.keyCode==46)&&inputElement.innerHTML.length>0) //backspace or delete { inputElement.innerHTML=inputElement.innerHTML.substring(0, inputElement.innerHTML.length-1); return 0; } if(event.keyCode!=0) { return 0; } if(event.charCode>47&&event.charCode<58&&inputElement.innerHTML.length<10) { inputElement.innerHTML+=String.fromCharCode(event.charCode); } } function checkAnswer() { if(parseInt(inputElement.innerHTML)==answer) { clearTimeout(timeout); timeout=setTimeout('flasherElement.innerHTML="";',3000); flasherElement.style.color="#00ff00"; flasherElement.innerHTML="Correct!"; } else { clearTimeout(timeout); timeout=setTimeout('flasherElement.innerHTML="";',3000); flasherElement.style.color="#ff0000"; flasherElement.innerHTML="Incorrect!"; } inputElement.innerHTML=""; generateQuestion(); } </script> <style type="text/css"> p { color:#ffc000; font-family:Verdana; text-align:center; } table { margin-left: auto; margin-right: auto; border-style:solid; border-width:1px; border-color:#00ff00; width:200px; } tr { height: 25px; } td { border-style:solid; border-width:1px; border-color:#505050; } </style> </head> <body style="background-color:#000;" onload="loader()" onkeypress="handleKeyPress(event);" id="body"> <table style=""> <tr><td><p id="quest"></p></td></tr> <tr><td><p id="input"></p></td></tr> <!-- <tr><td><p id="stats"></p></td></tr> --> <tr><td><p id="flasher"></p></td></tr> </table> </body> </html>
|
| Return to
javascript category list |
|
|
Who Visited EnigmaGroup Today?
1388 Guests, 225 Users (217 Spiders)
cat1vo, Pabz, lolzsec, tgm001, plex, Edika, TheCheeseDemon, rockcraft, recoveryToolbox, saraf, soufiaane, sickmind, mjneat, famous0123, Galagatron, dark_void, CJ_Omaha, junaid_junaid59, JohnJohnJohn, ssmaslov, psychomarine, Dregoon, Patrickk, Aska, Beat_Slayer, M0rdak, Ausome1, Imre, Vreality2007, mmndglxuwn, m0rt, unholyblood, iterrumzz, VurbTrurb, Mayonoula, MAMWOURBROR, mutabor, gobinda, cossyDrybrich, Razin, zaCruBumas8, hunja, johny34, pantoufle, bagy, arctica, hackarchives, UsedDeteKef, Peculator, Fadhilat606, TheTrueMonarch, Pascall01, hackaday, Tjm, arndevil, flairvelocity, lol, alphbond, kdivanov, elizbethallis6, Rik, bn11, BorgBot, SHASHANK101hello, 4poc4lyptic, ksajxai, nbmorri1, electro-technic, شمالي عرعر, lamb, AutobotPrime, Underleaf, The End, tomtombomb, killobyte, snowgirlx, so_saucey, zerolife, Althor, Cramps, Hekser, Hyperborn, cyber-guard, jhgrunn, cobra, Partisan, MAZI_, cyborg, GenbreedX, moel77, cliptoX, pwnpwnlolz, letshavepie, Mrwormz, yshiau, mirmo, roozyoppomo, soft_devil, cls777, scoobywan, Reiversed, joshua, st3alth, Afrika, PaiffDryday, venter, Anthony12796, sh3llcod3, 8FIGURE, Rannim, Evil1, maloaboy, BACanON, SlayingDragons, Repuhlsive, IvanDimitriev, 1RiB, mzungudo, Micro_Geek, iMaxx, aciboummamymn, k0unterkulcher, somebody777, m14m16, GoododotAlcob, negasora, Rastii, UninueMem, Swifsolja, ad.conquest, ngolatkar, Infinity8, Jigoku, thesupervisor, p0is0n5ting, kernel_mod, AKL, GothicLogic, themastersinner, dnatrixene135, ChewBigRed, kalak55, sejem, cve916, pollolololo, triecturn, Violatedsmurf, Ops, jmp, xsiemich, generalisimo, strudels, ga3ttpom, KingOfBritains, epoch_qwert, suten, FriskyKat, Ryuske, Adonis Achilles, ubqbcdzzhf, 3vil, Nightraven, US£RNAM£, Weindittewcon, Batesheelocot, GSmyrlis, MaxMeier, Elite.America, rabbidmind, Psiber_Syn, phoenix22, imittyerrotte, peewster, cyberturtle, ctb, dexgeda, sdw, Pizza, White_widdow, devarian, finesse, Nature112091777, Danc7171, Alphadragon, Estadagause, 53QR10U5, Xargos, Alkomage, hardlock, Barry Gonzoles, MineDweller, Gkjt, N4g4c3N, [I]nfectedbug, wimsteege, aqr5zdcw, xin214, Bugshuppy, SnoopSky, Hessesian, voodooKobra, sKcarr, IROverRated, W1F1G3NJU75U, Baddy, ziadmosaan, gamble86, realzs, CruelDemon, Shinju, aVoid, aquiredanonymity, kukumumu, web_request, callmeneon, KissMyDAFFODIL, Feld Grau, Abhinav2107, prabhataditya, mbuyiselo, shumer, phenom216, princennamdi, huskyboiza, ninety-nine |
| |
|
|
|
|
|