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 7184505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:12:56+00:00 2026-05-28T18:12:56+00:00

I started to make a simple domino game. (the one where you place the

  • 0

I started to make a simple domino game. (the one where you place the tiles with same numbers next to each other). I started modelling it and i seem to have landed in a tough spot now. Im modelling the actual domino (called “bone”):

namespace DominoCore
{
    public enum BoneOrientation { Horizontal, Vertical }

    public interface IBone
    {
        int FirstValue { get; }
        int SecondValue { get; }
        BoneOrientation Orientation { get; set; }
    }
}

After this type I need to lay them out on the playing field. I made a playing field with square tiles in it:

namespace DominoCore
{
    public interface IField
    {
        IPlayer FirstPlayer { get; }
        IPlayer SecondPlayer { get; }
        IBoneYard BoneYard { get; }
        List<ITile> Tiles { get; }

        void PlaceBone(IPlayer player, IBone bone, int startX);
    }
}

The playing field has two players and a Boneyard (the dominoes not given to players) and then a list of tiles.

namespace DominoCore
{
    public enum BoneExpandDirection { Up, Down, Right, Left }

    public interface ITile
    {
        int X { get; }
        int Y { get; }
        IBone Bone { get; set; }
        BoneExpandDirection ExpandDirection { get; set; }
    }
}

Now comes my problems:,

  1. If I get a domino (Bone) with the value of (1,3) and want to place it on the field, how do I represent the location of where it has been placed (e.g. tile with coordinate 5,5)
  2. Does the domino tile then expand to the right from 5,5?
  3. What if I turn it 90 degrees, then the orientation is upward, turn it 180 degrees then its to the left – and the value is now (3,1).
  4. How do I make this distinction between layout, domino and tile?

I guess at some point I need to figure out, when a player places a tile – to calculate if its legal (search the field for tiles/bones). The various placements of the same domino /bone is shown in image below.

The next problem is laying out the dominos/bones, I am thinking about making a grid, but that doesnt fit with placing a tile “across” (perpendicular) other dominos/bones. When placing a tile I’m back at the first problem: how to validate it its legal? how to find the domino it borders with?

Hope this is making sense – I find it hard to describe the layout and the validation problem im facing.

Various domino scenarios

EDIT
When starting the game the Bones in play are:

[6,6] [6,5] [6,4] [6,3] [6,2] [6,1] [6,0]
[5,5] [5,4] [5,3] [5,2] [5,1] [5,0]
[4,4] [4,3] [4,2] [4,1] [4,0] 
[3,3] [3,2] [3,1] [3,0]
[2,2] [2,1] [2,0]
[1,1] [1,0]
[0,0]

Each tile can be reversed this means that tile [6,3] can also be flipped 180 degrees and used as [3,6]

  • 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-28T18:12:57+00:00Added an answer on May 28, 2026 at 6:12 pm

    It seems like a grid is a reasonable approach, but it’s a logical grid, and doesn’t directly correlate to the physical layout of the tiles. Assuming the grid is a two-dimensional structure, roughly

    (0,0),(0,1),(0,2),(0,3)
    (1,0),(1,1),(1,2),(1,3)
    (2,0),(2,1),(2,2),(2,3)
    (3,0),(3,1),(3,2),(3,3)
    

    Then you need to keep track of the cell that a tile is in and it’s orientation (a byte or enum will do here, since there are only 4 possible values). checking for legality is easy enough- assuming that orientation is an enum:

    public enum BoneOrientation {
        Horizontal = 0
        Vertical = 1
        Reversed = 2
    }
    

    and you have some class BonePlacement:

    public class BonePlacement {
        public int X { get; set; }
        public int Y { get; set; }
        public BoneOrientation Orientation { get; set; }
        public IBone Bone { get; set; } 
    }
    

    Finally,

    // Assuming you have some `List<BonePlacement>` called placements
    public boolean ValidNextMove(BonePlacement placement) {
        if (placements.Count == 0) return true; // presumably the first move is always allowed
        if ((placement.Orientation && BoneOrientation.Horizontal) == BoneOrientation.Horizontal) {
            // The move being tested is a horizontal placement
            if ((placement.Orientation && BoneOrientation.Reversed) == BoneOrientation.Reversed) {
                // The tile is reversed
                // Check for a neighboring tile in an acceptable configuration
            } else {
                // The tile is not reversed
                // Check for a neighboring tile in an acceptable configuration
            }
        } else {
            // The move being tested is a vertical placement
            if ((placement.Orientation && BoneOrientation.Reversed) == BoneOrientation.Reversed) {
                // The tile is reversed
                // Check for a neighboring tile in an acceptable configuration
            } else {
                // The tile is not reversed
                // Check for a neighboring tile in an acceptable configuration
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started trying to make a simple game with XNA 3.1 to
I started a Android project on eclipse and make a simple loading bar, as
i'm new to android. I'm just trying to make one simple search functionality for
I'll try to make this as simple a posible. I just started working with
I started learning the Twitter API. I want to make a simple search for
I'm just learning C++ and so I have started to make a simple program
I am trying to make a simple game that goes across a TCP network.
So I've started to make a simple splash screen (it's more of an intro
I just got started with Mono Develop and Im trying to make a simple
I have just started out in Vala, and I tried to make a simple

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.