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

  • SEARCH
  • Home
  • 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 9219095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:01:26+00:00 2026-06-18T03:01:26+00:00

I am creating a Java Script/ HTML crapps game. I had the game working

  • 0

I am creating a Java Script/ HTML crapps game. I had the game working as you would roll a dice, it would tell you if you won, point was created, or lost. Obviously this game is not completed. I want to add code where it creates your point, then rolls the dice again until either point reached or 7 rolled. Here is my current code:

    function game()
    {
        if(point==4,5,6,8,9,10)
        {
            if(total==point)
            {
                if(total==6,8)
                {
                    var temp= 2.2 * bet;
                    alert("You win $" + temp);
                }
                if(total==5,9)
                {
                    var temp= 2.5 * bet;
                    alert("You win $" + temp);
                }
                if(total==4,10)
                {
                    var temp= 3 * bet;
                    alert("You win $" + temp);
                }
            }
            if(total==7)
            {
                alert("You lose. Please start a New Round");
            }
            else
            {
                setTimeout(rolldice(),3000);
            }
        }
        if(total== 2,3,12)
        {
            alert("You lose. Please start a New Round");
        }
        if(total==4,5,6,8,9,10)
        {
            alert("Point Established. Roll again.");
            var point=total;
            setTimeout(rolldice(),3000);
        }
        if(total==7,11)
        {
            var temp= 2 * bet;
            alert("You win $" + temp);
        }
    }

The function before this rolls the dice ans is called rolldice(). That function works as it rolls the dice and displays pictures as I like it. If I mentally go through the script, I cant see any errors. I went through all my bases- 2-12. What I do not know is if the first selection throws off function. At this point in the file, the point has not been created. Yet it needs to go first because if it goes through it a second time, it needs to go there. At first, I thought I was not calling this action. But I added an alert in the first line of the function and when I triggered this function the alert occurred. That tells me there is something wrong with my function. I went into Google Chrome’s console and it says there is an error called, “uncaught rangeerror maximum call stack” at line 130 which is at

if(total==7)……alert(“You loose”)

When I googled this, I found lots of stuff but as I am inexperienced and just typing it out not using jquery, I am a little confused.

  • 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-18T03:01:28+00:00Added an answer on June 18, 2026 at 3:01 am

    You should change expressions like:

    if(total==5,9)
    

    to something like this:

    if(total==5 || total==9)
    

    if you mean OR in your logic.

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

Sidebar

Related Questions

I am creating a basic modified Crapps game. I am using java script and
I am creating a image editing tool using HTML 5 Canvas & Java script.
I'm starting my hand at creating a multi-player game using HTML 5 / Javascript.
I need html - java script / jquery charts using single file. What do
I am creating one application in java-script which fetch information form LinkedIn which we
I was creating a simple web method to access from Java script..But I am
I would like to display a 'refresh' symbol in an HTML/JavaScript app I'm creating,
I'm working on creating a javascript game for my own education. The game requires
I have to call the web service using java script? e.g. I'm creating one
I am creating a chunk of HTML/JavaScript with the below code: $result = mysql_query(SELECT

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.