CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 4 of 4 FirstFirst 1234
Results 46 to 51 of 51
  1. #46
    Join Date
    Jun 2009
    Location
    France
    Posts
    2,513

    Re: a project for beginner

    I am particularly fond of puzzle games. I recommend you either do a text based GUI game, like Connect Four (http://en.wikipedia.org/wiki/Connect_Four), or Fifteen puzzle (http://en.wikipedia.org/wiki/15_puzzle).

    If you feel bolder, you can try to do automatic puzzle solvers, like sodoku solver, or nonogram(http://en.wikipedia.org/wiki/Nonogram)

    If you really feel bold, you can try to do a 15 puzzle solver, or a Connect four bot.

    I can GUARANTEE you will learn a lot from this experience. Personally, I would try to do them in this order, from easy to hard:
    Easy
    - Connect Four Game
    - 15 Puzzle Game
    OK
    - Sudoku Solver
    Hard
    - Nonogram Solver
    Harder
    - 15 Puzzle Solver
    Hardest
    - Connect 4 Bot

    I have been writing a new sudoku solver every year for the past 6 years, and have been learning something every year form it.

  2. #47
    Join Date
    Jul 2009
    Posts
    105

    Re: a project for beginner

    Quote Originally Posted by monarch_dodra View Post
    I am particularly fond of puzzle games. I recommend you either do a text based GUI game, like Connect Four (http://en.wikipedia.org/wiki/Connect_Four), or Fifteen puzzle (http://en.wikipedia.org/wiki/15_puzzle).

    If you feel bolder, you can try to do automatic puzzle solvers, like sodoku solver, or nonogram(http://en.wikipedia.org/wiki/Nonogram)

    If you really feel bold, you can try to do a 15 puzzle solver, or a Connect four bot.

    I can GUARANTEE you will learn a lot from this experience. Personally, I would try to do them in this order, from easy to hard:
    Easy
    - Connect Four Game
    - 15 Puzzle Game
    OK
    - Sudoku Solver
    Hard
    - Nonogram Solver
    Harder
    - 15 Puzzle Solver
    Hardest
    - Connect 4 Bot

    I have been writing a new sudoku solver every year for the past 6 years, and have been learning something every year form it.
    Thank you very much, i will do what i can to try each one of these and post any questions i have on here and the ending results. I do have one question first,

    What areas of C++ would i need to learn in order to complete connect 4.

  3. #48
    Join Date
    Jun 2009
    Location
    France
    Posts
    2,513

    Re: a project for beginner

    Quote Originally Posted by Alexz003 View Post
    Thank you very much, i will do what i can to try each one of these and post any questions i have on here and the ending results. I do have one question first,

    What areas of C++ would i need to learn in order to complete connect 4.
    Depends on how you want to implement it. I'd say you don't need anything but logic, and basic knowledge of the syntax, and the cout, endl functions. It will have you work with loops and ifs. If you want to get a bit fancier (which I recommend), you should create a class that represents the board, with a basic interface, so you can write things like.

    Code:
    connect4Board myBoard;
    myBoard.insertPiece(4,red);
    This would allow you to insert a red piece, in the 4'th row. In this case red is from an enum color.

  4. #49
    Join Date
    Jul 2009
    Posts
    105

    Re: a project for beginner

    See the only problem is i wouldn't know how to put it together because even though i have played connect 4 i still don't know how i can set limitations on the board size and where the pieces of the computer go.

  5. #50
    Join Date
    May 2007
    Location
    Scotland
    Posts
    1,164

    Re: a project for beginner

    Quote Originally Posted by Alexz003 View Post
    . still don't know how i can set limitations on the board size and where the pieces of the computer go.
    The computer pieces stay on the desk.

    I wouldn't worry about AI for a computer opponent yet. Just get the game working in two player mode (i.e. two human players) first.

    With regards to the board. That stays the same size, so you could create yourself a 2D array object that holds board pieces.

  6. #51
    Join Date
    Jun 2009
    Location
    France
    Posts
    2,513

    Re: a project for beginner

    Quote Originally Posted by Alexz003 View Post
    See the only problem is i wouldn't know how to put it together because even though i have played connect 4 i still don't know how i can set limitations on the board size and where the pieces of the computer go.
    Use simple English to describe your problem, and things will fall into place:
    -You want to simulate a Connect4 game/object: Create a Connect4 class
    -A connect4 game is a grid of pieces: 2D Array
    -Pieces in the board can be either empty, black or red: Enum
    -You need to put pieces into the board: create a insertPiece Method.

    Once this is done, all you use your board: Have two players take turn putting pieces into the board. Display the board after every play, and keep going.

    My advice is to keep it simple, create something that works, and then make it progressively better. Take it one step at a time, and you should make it.

Page 4 of 4 FirstFirst 1234

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured