Thread: Board Game

  1. #1
    Registered User
    Join Date
    Jul 2015
    Posts
    4

    Board Game

    I need help for this particular question. I haven't learned anything about game programming , however, I have to write a game program which i have no clue on how to start. I would appreciate it if someone could help me on starting this question. Thanks.

    Board Game-qns5-jpgBoard Game-qns5_1-jpg

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,739
    That paper is very descriptive. What do you have problem with?
    Devoted my life to programming...

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    If you have no clue how to start the program, then you are not ready to write code. Writing code is only a small part of programming. Planning a program is another important skill you need to learn.

    So forget about code for the moment and start planning this program.

    First, I would suggest creating a list or a flowchart that shows the "big picture" steps you need to complete this program. By that, I mean a list general steps - nothing "language-specific". Read through the problem and extract out this information for your list.

    For example, the beginning of the list might look like this:

    Code:
    /*
    - Create a gameboard
    - Prepare gameboard by randomly scattering 15 of each resource
    - Generate the number of turns for the players
    - Randomly determine who will go first
    - (and so on ...)
    */
    Make sure all necessary steps are included, and they are included in the right order.

    Now that you have a "big picture" plan, you can go through each step and start adding more detail. For instance, if values are needed, include how they are generated, what the expected ranges are, limitations, etc. You can also break up a step into smaller pieces if it is too broad.

    At this point, all relevant information should have been extracted from the description of the assignment, and you should have your own list that describes how you will approach the solution. You can also starting figuring out what functions you will probably need, as well as data types you will need.

    Now that you have a detailed list, the question of "where to start" is clearly answered right in front of you.

    When you begin coding, just write a little bit of code at a time, compile, and test. When you are sure that is working, you add some more code, compile, and test. Build your program up gradually, working off of your list, testing as you go.

  4. #4
    Registered User
    Join Date
    Jul 2015
    Posts
    4
    I have created a list showing all the steps that I have to create. However, i'm stuck at the part where I have to generate 15 random [x,y] to hide 15 of each resources across the 10 x 10 board.

    Code:
    Start- Create 10 x 10 board
    - Generate 15 random [x,y]
    - Insert food
    - Generate 15 random [x,y]
    - Insert 15 random [x,y]
    - Insert weapons
    - Generate 15 random [x,y]
    - Insert medical supplies
    - Generate 15 random [x,y]
    - Insert water
    - Generate P|15 =< P >= 100
    - Generate random 1/2
    - If else statement for player turn
    - Generate 15 random [x,y]
    - Send player to square
    - Generate random 1/2
    - If statement( if is 1), detonate 3x3 area.
    - To board status
    - Player scores
    - If statement for (is no of turns >p?)
    - Yes - Player Won
    - No - start value +1 
    - if statement for if there is item 
    - Yes - Collect
    - No - To board Status
    - Player scores
    - If statement for (is no of turns >p?)
    - Yes - Player Won
    - No - Start value +1
    - Stop
    This are the codes I did so far.

    Code:
    #include <iostream>
    using namespace std;
    
    
    int main()
    {
        int array[10][10];
        int food[15];
        int weapon[15];
        int medicalsupplies[15];
        int water[15];
    
    
        for (int x = 0; x < 10; x++)
            for (int y = 0; y < 10; y++)
                array[x][y] = rand() % 900 + 100
    
        return 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Snakes and ladders board game
    By ghertyish in forum C Programming
    Replies: 8
    Last Post: 11-13-2012, 08:08 AM
  2. Board game in C
    By sssk9797 in forum C Programming
    Replies: 85
    Last Post: 04-04-2012, 07:10 AM
  3. Board Game
    By Tiago in forum C Programming
    Replies: 4
    Last Post: 04-10-2010, 09:33 AM
  4. Tilting board game
    By vonxi in forum Game Programming
    Replies: 6
    Last Post: 02-18-2010, 01:06 PM
  5. Board Game
    By Govtcheez in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 08-17-2001, 12:29 PM