Generates A Random Number Between 1-1000 And Then Allows The User To Make Guesses In A Text Box
Apr 15, 2010
I'm having to write a program that generates a random number between 1-1000 and then allows the user to make guesses in a text box, answering to high or to low, until the correct answer is entered. I had the program working fine with using strictly prompts and alerts but when I tried to create a form I started having trouble.
<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns = "http://www.w3.org/1999/xhtml">
I have this script that is supposed to check if a number the user guesses is the same as the randomly generated number.Problem is that the random number generated at the start of the program keeps on changing everytime I click on the "Check if I'm right" button, the random number gets generated again and I never ever get to reach the correct answer
HTML CODE <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>
I am trying to make a random number between 1 and 1,000. I have a code that seems to work correctly, but I don't completely understand it and after looking online I think it might be wrong. Code: var rnd = Math.floor(Math.random()*999)
I have a background that is a shelf full of books, I wanted to figure out what I would need to do in order to make a random number of books pop out on mouse over (individually), and upon click have the book pulled out and be flipped through and read like a book. Would I have to recreate the library picture completely to make the random books moveable? And would I have to create the books that I want to move from the bookshelf?
how to pull the book out from the book shelf so that it looks like it's coming towards me and then to make it look like it has been pulled out. Would I need to use animation for this? What would be the parts to the animation required?
I have a site, im expecting a few hundred colleagues to sign up, they have the chioce to pick a user name and email adress of their choice, but to speed things up a bit I would like set preset usernames and emails in the fields so the user just has to press the enter button.
So for example, my 2 fields will be filled with something like Username: [mysitename]User[randomnumber] Email: [randomnumber]@mysite.com
where my site name is the actual name of the site, and the random number will be different on every visit.
I have a character countdown that tell you how many characters you have type in the text area. But I am having a problem, I can't see to show a text or the number the character the user when I load the page. I want it to show Characters Type: 0 when you load the page, and not having to press a key to show it, here is the code I am using...
Day 1, Title 1, Description 1 Day 2, Title 2, Description 2 Day 3, Title 3, Description 3 Day 4, Title 4, Description 4
I would like to add a checkbox (entitled "Same as Previous Day") that allows the user to duplicate the previous entry, populate the fields so the database is properly filled, and make the fields it just populated uneditable. So for the example, if day 2 and 3 were the same as day 1, I could select a box for each day 2 and day 3 and their titles and descriptions would be filled with the information from Day 1.
I have a form that has multiple text fields but what I'm needing to do is when a dollar amount is added to text field 1 I need to set the opposite amt in text field 2 and then NOT allow the user to make any changes to text field 2 but making it unavailable for change.
I set myself the task of creating a button which, when pressed, switches the background color randomly. It seems to work well enough but the random number it works from only generates once at page load.As a workaround, I added a second 'Reset Page' button, but I really want just one button that switches the page color every time you prod it. Any ideas how to reset the random number to achieve this?Here's the code.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
All the numbers should match. It's not working right in any version of IE I test it in (6, 7 and 8). I'm also using jQuery, fyi.When you click the button to stop the numbers, I'm setting a variable named winner to a number (3, 4 or 5). Right now, I have it set to 5. This number determines how many of the slots match:[code]I'm then generating a random number (0-8) to base all the other numbers off of . Three numbers will always match, so I'm setting two more variables to match that random number.[code]Then I do some conditionals to check the value of winner. If it's 4, I set the 4th number to random number, then generate a random number for the 5th spot while it doesn't equal randomnum. I do something similar if winner is set to 5.[code]The goto trigger sends the scroll to the specified index according to slotnum(1-5).I'm waiting to hear back from the plugin developer to see if it's something to do with that.However, I just want to make sure my logic in generating those numbers is sound. It works perfectly in FF, Opera and Chrome but (surprise!) not in any of the IEs (tested in 6, 7 and 8).
I am trying to make it so that when you press a button it prints out a random number. This is what I currently have:
When I click on the button it just clears all the text from the page and clears the bgcolor. A random number then appears at the top left corner. I am trying to make it so that when I press the button it prints out a random number just above or below the button. Is this possible? if so how do you set it up?