+ Reply to Thread
Results 1 to 9 of 9

Game of craps

  1. #1
    Registered User
    Join Date
    11-01-2007
    Posts
    2

    Game of craps

    I need help with building a formula using IF, AND, OR functions. Can someone help. Thanks!

    In a game of craps, on each roll of the dice after the first roll, the rules are as follows: If the game has not ended and the current roll matches the first roll, we win the game. If the game has not ended and the current roll is a 7, we lose. Otherwise, the game continues. Develop a spreadsheet that tells us (given knowledge of the first four rolls) the status of the game after four dice rolls.
    Last edited by ldickson; 11-01-2007 at 07:07 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    See if link helps

    http://www.mrexcel.com/tip119.shtml

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    11-01-2007
    Posts
    2
    Thanks for the tip...I went to that site but I'm still confused about his solution and formulas.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe this link will help

    http://www.excelforum.com/showthread...highlight=dice

    VBA Noob

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,727
    Quote Originally Posted by ldickson
    Who knows the game of craps? How do I create a formula for four rolls.
    At the most basic level you can simulate the roll of a die with this formula in any cell

    =INT(RAND()*6+1)

    which returns a random integer between 1 and 6, so you can simulate the rolling of a pair of dice with that formula in two cells, press F9 and the numbers change, i.e. new roll

  6. #6
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    Anyone for a game of craps?
    press F9 to "Roll"
    Attached Files Attached Files
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Not bad.

    The one on the link is also good


    VBA Noob
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    VBA Noob,

    Interesting and the formula is RANDBETWEEN(1,6) which is much simpler than =INT(RAND()*6+1)!

  9. #9
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    I like the way to call the dot

    =IF(A2>1,CHAR(108),"")
    cell formatted as Wingdings

    The Randbetween needs the Analysis ToolPak add-in installed


    VBA Noob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1