Dice Roller - Passing - Rolling - Output ?
Oct 30, 2011
I am taking a JavaScript class and I am currently on an assignment where my Professor wants me to create a dice roller program with the following stipulations:
Now to the problems. I have set up to where it will take the form, pass it to my "sidecheck" function, but I do not think it is passing it to the Die() function to roll the die. As far as the output part of it to show roll totals and percentages, I am lost on that one.
Below is my code and what I have so far.
View 1 Replies
ADVERTISEMENT
Mar 7, 2011
Before I go on, I should state that I know little of Javascript - tried learning it once, but it was way over my head.
On to the problem: I found a script that will roll dice and post the results to the page. In my case, everything is working except for the fact it doesn't post the results.
Here is the dice roller: [url]
What it should be doing: [url]
I've sent a message to it's creator, but he hasn't responded yet. I'm not sure what exactly the problem is, so I won't post the page source here (it can get fairly long).
View 4 Replies
View Related
Nov 14, 2011
Create a game where 6 dice are 'rolled' by you and 6 dice are 'rolled' by the player (simulated by the click of a button). Add up both rolls. The goal is to come as close to a score of 100 as possible, without passing 100. Have a STOP button to signify when you are ready to stop rolling and compute the winner. The highest score under 100 wins. Display the number of times you win and the number of times the computer wins using javascript. So far I have the following code, however, my dice images are not working(they display as little broken symbols when I run the game). The game itself is running just fine but I can't figure out how to get the game to do the "Add up both rolls" step and beyond.
View 1 Replies
View Related
Jan 23, 2011
I'm curious if this is something simple. I'm working on a wordpress site using a plugin that is based off of the code from javascript kit called "highlighter scroller script". The plugin js is almost identical:[URL]..
What is causing it to wipe from left to right? I'm racking my brains trying to figure it out (and googling unsuccessfully it seems). All I'm trying to do is make it wipe instead from right to left. I'm sure it's something simple, but I don't know which variable to change.
View 1 Replies
View Related
May 19, 2009
I am looking for a way of hiding a submenu and the rolling over an image which is the menu item. It will trigger the submenu to slide down. It needs to be hidden to start and visible when the user rolls over the image. I have tried numerous scripts. All seem to have one bug or another.
View 1 Replies
View Related
Mar 27, 2010
I am looking for a way to change an image when a link is hovered over. I should make it clear that it is not the list/link image i want to change but an image along side in order to "illustrate" the content.
View 1 Replies
View Related
Jul 30, 2006
Im making an employee roster in HTML... I want to be able to rollover (hover) on the employees name (text) and have an image come up, next to the mouse (floating on the screen) when I rollover someone elses name do the samething... when Im not over anyones name I dont want any images there.
View 4 Replies
View Related
Aug 4, 2011
I have an image that I start out with opacity = 0. Then when I rollover the image area the opacity is set to 1 so I can see the image, and when I roll off of the image the opacity is set back to 0:
This works fine. But the image has an image map that defines a small hot spot. When I roll over the hot spot the image hover state is interrupted and the image goes away. Does anyone know how I can keep the image hover state active when rolling over the image hot spot?
View 3 Replies
View Related
Apr 10, 2010
I am studying webdesign and we also go through a chapter of javascript-programming. Our first assignment is to create a dice game. I have written a code and in the beginning it worked, except that all the dices showed the same random number. I tried to fix that and now I do not know what I have done! In the game, you shall click on a link and the three dices will show random numbers.
Here is my code:
View 1 Replies
View Related
Nov 5, 2004
I am having trouble creating a page that stimulates a large number of dice rolls and computes the average of the dice totals in an separate text box. Code:
View 1 Replies
View Related
Mar 30, 2009
I'm making a dice program, that randomly draws x amount of times for x sided die. I decided to add on a "history" feature to this program--displaying the previous rolls (unlimited I imagine) and to show the math that comes from that equation. Everything works perfect except for the history function.
I've got a div area sectioned off with the id divhistory. At the end of the dice rolling program it calls function fhistory(z). Where z is the string that displays the random rolls and total (1 + 3 + 2 = 6).
Heres the code I've been fusing over. I imagine it's horribly off--but I'm also terrible with arrays it seems...
View 2 Replies
View Related
Nov 16, 2009
I'm trying to make a dice game, as well as making it two player. I need to be able to have a scoreboard displayed (eg. player 1 has won 7 times and player 2 has won 4) and I need to be able to prompt the user on if they want to play the game again.
So far I have the following:
I basically just tried duplicating the original function that adds up the 'dice'. But it doesn't work, I've tried playing around with if/else statements etc to get it to display messages and so fourth, but I have failed.
View 1 Replies
View Related
Mar 28, 2009
Im currently taking some computer science courses in university and kind of enjoy this javascript stuff! im trying to figure out this final program...
Here is what is needed: Enhance the previous example, so the user can bet on the outcome of the roll, i.e. she can try to guess if the roll is going to be even or odd. If the user makes the right guess, she wins the amount of the bet, otherwise she loses the amount of the bet. The initial value of the wallet should be 100.
You should use 3 functions for this exercise. One function is executed when the user presses the button. The other functions (win and lose) are called by the first function when the user wins or loses.
This is the code i have so far. The "first function" was working perfectly. Now not only will the picture not show up when the "Roll!" button is pressed, but i cant figure out the even and odd assignments.
View 14 Replies
View Related
Dec 9, 2011
How to make a dice game for two player in javascript and html using just two dice?
1. Each player throws both dice once per turn. You only score if you throw doubles (that is, both dice have the same number of spots on their top face).
2. Players score five points for double ones, twos, fours or fives. A double six scores twenty five points, but if you throw a double three your score goes back to zero.
3. Add your score as you play. The first player to get fifty points wins the game. (An adult or older child may need to help score, but you can use this game to teach younger children to count by fives.)
View 3 Replies
View Related
Jun 10, 2009
I am just about finished the dice game but am having trouble doing the calculation where if a player wins then they double their venture. I am not too sure how the game stores what the user picks in their venture 100 or 200.
I am already subtracting their venture from the total when they initially make their venture. But if they win then I need to add back the venture to the total by 2. Not too sure how to do this. Do I use a new function. How can I tell which button the user chooses 100 or 200 and then add on that amount.
[Code]...
View 6 Replies
View Related
Nov 10, 2010
Developing a dice game. I'm totally new at this so a bit confused with the javascript language...
Anyways, heres my code:
So what i need help with is my pictures. They wont show. Firebug says: "document.getElementById("dice" + i) is null", and I have tried to solve that but with no progress...
Next step is to show the sums of the dices on the screen and also save this sums to be able to show them later on in an alert window... But that is for later, right now the dices needs to show the right (random) sides...
View 9 Replies
View Related
Nov 15, 2009
Im trying to make a dice game. how to get started n stuff. Something that will create a random number b/w 1 n 6 and decide if the user is a winner. He will win only if the #s are equal
So i want a text box for the first number and text box for the second. a button to click to play the game(roll the dice) button to start over and reset all values textbox to display the # of tries(rolls) textbox 2 display the # of wins. Also i want toKeep track of the number of times the user rolls the dice and display this in the appropriate textbox and the number of times the user wins the game and display this in the appropriate textbox.
Well my friend helped me with this but he made 2 player i only want one player and i want the number of tries and win the user wins if the #s are equal and i want a start over button that resets everything. Also the max number i want is 6 and only one roll the dice button but 2 textboxes so if you get same # you win it should appear in alert and text box for tries and wins. Also, i am gonna have 2 pics one for the first textbox the other for the second both of the pics are gonna be dice and i am gonna have 12 pics but only 2 appear at a time so if a guy gets 5 the dice with the #5 appears and the other text gets 4 the dice with the # 4 appears
<html>
View 26 Replies
View Related
Sep 30, 2009
I'm passing the variables myTitle and myLink to form.php using javascript.
This is the way I'm doing it:
Code:
<a href='form.php?title=" + myTitle +"&link="+myLink+">Click me</a>
It's working great but sometimes myTitle and myLink contain the plus character (+). When this happens it's not passed. In the case of the title, it's just a problem of looks but in the case of the link, well, the link won't work without the character.
As an example if the title is: Laptop + Accessories What is passed is: Laptop Accessories
What can I do to pass also the plus character??
View 4 Replies
View Related
Jul 23, 2005
There's a setting in php.ini: zlib.output_compression = xxx
If it is set to "On", php will bzip the output of scripts so that there is
less data to transfer to the client.
I found that this setting is quite useful especially on slow connections,
but I have a slight problem with it: it also compresses output of scripts
which generate pdf files. While Mozilla / Firefox handles this well, IE
simply fails to show the document.
Is there any way to tell PHP not to compress output of certain scripts. Is
there a command for that?
View 1 Replies
View Related
Mar 16, 2009
I have this script here but im struggling to add commas to the output to seperate the figures. e.g. rather than 10000, I would like 10,000 here is the script:
This year approximately <span id="fires" ></span> people have died in a fire.
View 3 Replies
View Related
Oct 4, 2009
I cant get seem to get this array to print the numbers 1 to 15 out. When I preview I get nothing, anyone know what I am doing wrong?
View 1 Replies
View Related
Sep 7, 2011
I thought I knew how, but I'm unclear how to get this function to display: document.getElementById("txtHint").innerHTML=xmlhttp.responseText;" inside the div.
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
var div = document.createElement('div');
[code]....
View 3 Replies
View Related
Nov 16, 2011
How do you simply output the current url in the browser i.e if i am in google.com I want google.com outputted and so on.Also on multilanguage sites if my url is say www.mydomain.com/en/about.html or www.mydomain.com/en/animals/horses/racehorses/stallions.html I want to be able to manipulate the url so I can change en to fr for example when I jump between english and french pages. I want users to be able to switch the language of that particular page by clicking a link. I need to be able to switch segment one of the url (en,fr,de etc...)dynamically somehow instead of hardcoding a link into each page.
View 2 Replies
View Related
Oct 7, 2009
Ok Im am so very lost on what to do now, I have written the php code and would like to display the contents of what is being echoed through the url.Example is by enteringmywebsite.com/index.php?dog=dogs it returns "a dog"mywebsite.com/index.php?dog=littledog returns "a little dog"What I would like to do is display the output of the urls to my webpage using javascript in popups. I have the pops written already I just need to be able to display the output.Please note that some of the pages are html so I would like to do this in javascript.
View 1 Replies
View Related
Jul 2, 2010
function args() { return arguments; }args(); the reault is []?what's the "return arguments; meaning?
View 1 Replies
View Related
May 25, 2011
how I can style the html output of the following statement:
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
[code]....
View 13 Replies
View Related