Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9167421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:23:12+00:00 2026-06-17T15:23:12+00:00

I will flash a scrambled word and then the user will type in what

  • 0

I will flash a scrambled word and then the user will type in what the scrambled word is.

So far I have this code. This is for shuffle and display.

document.getElementById("shuffle").value = shuffle(document.getElementById("word").value);
var shuffledword = document.getElementById("shuffle").value;
var z = shuffledword.split("").join('    ');
var x=document.getElementById("demo");
x.innerHTML=z;

var str=document.getElementById("demo").innerHTML; 
var n=str.replace(charcode,"...");
document.getElementById("demo").innerHTML=n;

What I want is to restrict the user to input the same number letters as in the shuffled word. Example: the word is “DOOMED”; I want to make it so that the user cannot click the letter D and O three times, but only once or twice. Same for the other letters, depending on the number letters in the shuffled word.

It this possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:23:13+00:00Added an answer on June 17, 2026 at 3:23 pm
    // Set an object with each letters of the (shuffled) word and their count
    var letters = {};
    for (var i=0 ; i<word.length ; i++) {
      var c = word.charAt(i);
      if ( ! letters[c]) letters[c] = 1;
      else letters[c]++;
    }
    
    ...
    
    function process_user_char(K) {
      // When user enter letter K
      if ( ! letters[K]) {
        alert("You cannot enter " + K);
        return false;
      }
      else {
        letters[K]-- ;
        return true;
      }
    }
    
    ....
    
    // To check wether user entered all letters, returns Yes or No
    function check_if_user_entered_all_letters() {
      for (var o in letters) {
        if (letters[o]) return "No";
      }
      return "Yes";
    }
    

    edit Added return true / false in process_user_char to integrate into onkeypressed.

    Here is the jsfiddle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code will open a Flash in a Window after being executed. Is there
Adobe are launching Flash Player 10.1 in the first quarter of 2010, this will
The Zend_Amf specification states that a Number type returned from flash will map to
I have the following code in page1.php : <a href=page2.php onClick=javascript:callFlash();>Go to page</a> This
The front-end will be Flash, to run in a browser and have access to
I'm looking for a Flash/Flex component which will create a popup editing balloon, similar
Flash Player 10 specifies: Redirects to policy files outside the originally requested domain will
I am creating a presentation in Flash, which will be displayed on a 42
I want to disable camera flash. How can I do that? Any help will
Will the following code cause a ConcurrentModificationException or other side effects? ArrayList<String> newList =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.