+ Reply to Thread
Results 1 to 4 of 4

How to design a simple guessing game, played by one player against the computer.

  1. #1
    Registered User
    Join Date
    05-02-2015
    Location
    Tabubil,Papua New Guinea
    MS-Off Ver
    MS Office 2010
    Posts
    5

    How to design a simple guessing game, played by one player against the computer.

    I need help to solve the following problem. It is an assignment which dues next week.

    When the program begins it will ask the user for their name, then welcome them to the
    Guessing Game, saying “Hello <name>, welcome to the CP1401 Guessing Game”. The game
    will then begin, displaying the players name and current balance (which starts at $100). The
    player will be asked how much they want to bet, which must be a whole number no less
    than 1 and no more than their balance.

    Once their bet has been entered the game will randomly generate two numbers, one for the
    player and one for the computer. These numbers are to be whole numbers between 1 and
    13 (representing cards: Ace, 2 -10, Jack, Queen, King).

    The player will then be told the value of their card as either a number (if the value is
    between 2 and 10) or the name of the card (1 is an Ace, 11 is a Jack, 12 is a Queen, and 13 is
    a King). The player will then choose whether they think the computers card will be higher or
    lower, by entering H or L. Upper and lower case must be accepted, but any other input will
    result in an error and being asked again. Once the player has chosen then the computers
    card will be announced to the player.

    If the player was correct they get double their bet back (e.g. started with 100, bet 10
    (balance is 90), win 20 (balance is 110). If the player was wrong they lost their bet (e.g.
    started with 100, bet 10 (balance is 90)), and if the two cards are equal then it’s a tie (e.g.
    started with 100, bet 10 (balance is 90), get 10 back (balance is 100)) and the next round
    starts.

    Each round follows the same pattern:
     Display name and balance
     Take the bet
     Reveal players card
     Get players guess
     Reveal computers card with winning/losing message, update balance

    After each round the player can choose to continue, or quit. If the players balance hits zero
    then the game ends, as if they had chosen to quit.

    Once the game ends a farewell message will be displayed, noting the final balance and
    whether or not the player won (or lost) money overall

    I am new to excel vba please assist me in solving this.

    Thanks much in advance.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: How to design a simple guessing game, played by one player against the computer.

    We do not do your homework for you. If you have made progress and have a specific question about an Excel feature that is giving you trouble, we are happy to help. But please do not post your assignment and ask us to complete it for you. That is what you are supposed to be learning in your class. We can help once you show that you have done some work on your own to get started.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    Re: How to design a simple guessing game, played by one player against the computer.

    Here's a start…


    Please Login or Register  to view this content.

    You now have only 2437 or so more instructions to go.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: How to design a simple guessing game, played by one player against the computer.

    StuCram please do not post after a Moderator has posted a warning and before the OP has rectified the situation, or you could subject to an infraction. Also, your post reads more as sarcasm than help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Calculate how many minutes player played in sports match
    By tlacloche in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-14-2013, 05:26 AM
  2. Replies: 3
    Last Post: 06-10-2008, 07:53 AM
  3. [SOLVED] How do I design a little game by excel?
    By ´¿¬ê´_ in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-20-2006, 03:12 PM
  4. How do I design a little game by excel?
    By §õ¨Ì¤Z in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 04-20-2006, 04:15 AM
  5. Game score without game being played
    By Sheila in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 05-17-2005, 07:06 PM

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