can some body help

This is a discussion on can some body help within the Game Programming forums, part of the General Programming Boards category; For the project, you have to design and write a C program that implements: a two player game. 1. You ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    5

    can some body help

    For the project, you have to design and write a C program that implements: a two player game.

    1. You may select any game you want as long as it meets the following requirements:
    a. It has perfect information. (Each player has access to all of the information needed to make the next move for all turns.)
    b. There is no chance involved.
    c. It must be finite. (Have a winner and loser.)
    d. It must be a two player game. One of the players must be the computer.
    e. There must be some variables in the set-up of the game (whether it is regular or mise're, the number of sticks, the size of the board, the number of dots, the number of and size of the piles, ...) that make sure that for some variations of the game A has a winning strategy and if possible, for some other variations of the game B has a winning strategy. (A goes first.)

    mona

  2. #2
    mano
    Guest

    Unhappy plz could one help with this one

    plz plz

  3. #3
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    What is it exactly you're looking for in terms of information? Did you want a suggest for a game to do? If so I would try to keep it easy, since it seems that this is your first game you will be creating; tic-tac-toe or connect four would probably be your two best choices. You can do a search for more info on these games. There are a lot of examples (source code) to look at here.

    Good luck.

    Btw, make sure you read the board FAQ.

  4. #4
    Registered User
    Join Date
    Nov 2002
    Posts
    5

    thanx ..... but i still :(

    TechWins thank u so much ,

    so i just need the code fot any game they want of me.

    if u could help me with it that very nice
    if not i have to thank u abuot the answerd

    mone

  5. #5
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Here's a simple game, it shouldn't be too hard to convert into C:

    Code:
    //
    // COIN GAME
    //
    
    //for wait command
    @include "Expansion"
    
    print "This is a coin game, 21 coins is placed on a table\n"
    print "you may pick up one, two or three coins. The player\n"
    print "who picks up the last coin loses.\n\n"
    
    //number of coins left
    coins = 21
    
    //Set a fancy color
    //doesn't work with all operating systems
    system("color 18")
    
    repeat
    
     //Print the number of coins on the table
     call PrintCoins(coins)
    
     //Get the player's number of coins
     print "\n"
     repeat
      print "How many coins would you like to pick up? (1-3) :"
      user = input
     //must be valid
     until ((coins - user) >= 0) && (user > 0) && (user <= 3)
    
     //Pick up the coins
     coins -= user
    
     //Is it a loss?
     if coins == 0
     begin
      system("color 1c")
      print "You lose!!"
      call wait
     end
    
     //"AI"
     computer = 4 - user
    
     //Pick up the coins
     coins -= computer
    
     //Is it a win?
     if coins == 0
     begin
      print "You win!!"
      call wait
     end
    
    until coins <= 0
    
    //Exit program
    exit
    
    procedure PrintCoins(coins)
    
    repeat
     print "O "
    until (coins-=1) <= 0
    
    return
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  6. #6
    Registered User
    Join Date
    Nov 2002
    Posts
    5

    Smile thank you (Sang-drax )

    Sang-drax thank you so much

    see u soon

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. html header and html body
    By Checker1977 in forum Tech Board
    Replies: 18
    Last Post: 11-23-2008, 05:52 AM
  2. Enum and body parts
    By Rahtgaz in forum C++ Programming
    Replies: 6
    Last Post: 07-17-2006, 05:05 PM
  3. scrolling text in the body
    By task in forum C Programming
    Replies: 7
    Last Post: 05-18-2002, 11:16 AM
  4. is this required in a function body?
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 09-26-2001, 04:20 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21