Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Coding Releases > Coding Snippets
You last visited: Today at 17:39

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Solver for JavaScript guessing game

Discussion on Solver for JavaScript guessing game within the Coding Snippets forum part of the Coding Releases category.

Reply
 
Old   #1
dotCom




 
Devsome's Avatar
 
elite*gold: 300
The Black Market: 101/0/0
Join Date: Mar 2009
Posts: 13,287
Received Thanks: 3,712
Solver for JavaScript guessing game

Hello Elitepvpers.com

small solver for , yeah you can check the HTML code for the right answer.

Small Javascript script to show you the right answer.

Code:
var go = false;
var intV = 0;

function getAnswer() {
  [].forEach.call(document.querySelectorAll('button[data-v-2]'), function(div) {
    var txt = div.textContent || div.innerText;
    if ( "" + txt.replace(/\s/g, '') == (document.querySelector("img[data-v-4]").alt).replace(/\s/g, '') ) {
      div.style.color = "red";
      div.addEventListener("click", function(e) {
        div.style.color = "#66bb6a";
        go = true;
      }, false);
    }
  });
}
function startLoop() {
    if(intV > 0) clearInterval(intV);
    intV = setInterval( "work()", 1000 );
}
function work() {
  if(go) {
    getAnswer();
    go = false;
  }
}

getAnswer();
startLoop();
Devsome is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[PHP/Javascript] My first (little) browser game
08/21/2014 - Coding Releases - 19 Replies
Hi guys! I'm an italian guy and i'm trying to code with PHP/Javascript a little browser game, if you want to try it it's pretty easy and funny Home It's just a remake (made by me) of the classic cookie clicker. I originally made it in italiand and transladed it in english so if i made some mistakes please tell me and i'll fix them ^^ Before playing you only need to register with an username and a password that allows me to store save your datas to be shown in the global ranking :) If...
ITS THE GUESSING GAME???
04/10/2011 - Grand Chase - 7 Replies
if u have guess this site u will win the prize inside it 1. guess the 3 missing number, letter etc mediafire.com/?njc4l0nd8yji___
How to Use Guessing Game
03/31/2010 - Grand Chase Hacks, Bots, Cheats & Exploits - 1 Replies
ignis moutain manual how to use
Guessing Game. Win GCPH Accounts.
03/25/2010 - Grand Chase Philippines - 56 Replies
Who is this character?: http://i754.photobucket.com/albums/xx182/ZeroType X/Guess.gif -Winner- L,Freedom. http://i754.photobucket.com/albums/xx182/ZeroType X/Guesss.gif-Winner kaizer.zero. Changed. If you know him or her Post it here. And win some accounts.
guessing game win GCPH acc
03/22/2010 - Grand Chase Philippines - 10 Replies
who is this singer?? ...



All times are GMT +1. The time now is 17:39.


Powered by vBulletin®
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2023 elitepvpers All Rights Reserved.