Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6766847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:52:49+00:00 2026-05-26T14:52:49+00:00

I was trying to implement the Sorry! board game using C++ such that 4

  • 0

I was trying to implement the Sorry! board game using C++ such that 4 players (Includes computer as one of the player) could play the game over a network and there is also a score board and a message board for the players to chat.

The main idea is to crystallize my understanding of C++ and use almost all OOP concepts while implementing this game.

I was trying divide the problem into classes and had 2 questions:
1. Each player green, yellow, blue, red have 4 pieces each. Is each piece a class or green1class, green2 class ….. or is it just that each color is a class and each piece of the same color is just an instance of the class.
2. Also How do I start dividing a generic problem like this into classes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:52:50+00:00Added an answer on May 26, 2026 at 2:52 pm

    Start thinking in objects, and in a “is a” and “has a” manner kind of like this:

    A game piece is an object

    A player is another object.
    A player has 4 game pieces.
    A player has a color

    A gameboard is an object.
    A gameboard has spaces.
    A gameboard has 4 players

    And so on. As you get used to thinking in a “is a” and “has a” manner, it gets easier.

    Also try to break down things to the lowest level – if every player has a color, then maybe player should be an object that has a color, instead of 4 player objects based on color

    Do this (I know this is not proper c/c++ code, but it demonstrates the ides):

    class Player
    {
     string Color;
     Piece[] Pieces[4];
    }
    

    instead of

    class RedPlayer
    {
     RedPieceOne Piece1
     RedPieceTwo Piece2
    }
    class GreenPlayer
    {
    }
    

    etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I'm currently trying to implement a function using C that takes in
im trying to implement the n-queen problem board game and im having problems with
trying to implement a dialog-box style behaviour using a separate div section with all
when trying to implement an Aspect, that is responsible for catching and logging a
I am trying to implement least squares circle fitting following this paper (sorry I
i'm trying to implement paging in xml using this code and got around to
I'm trying to implement a click-like effect on my horizontal tab menu using opacity
Sorry that the question of this problem might be a bit vague. I'm trying
I am trying to use StructureMap to register some types that implement a generic
I'm trying to implement encrypted columns in EF4 and using the CTP5 features to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.