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

  • SEARCH
  • Home
  • 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 7701371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:58:07+00:00 2026-05-31T22:58:07+00:00

I was tasked to make a basic Pegz game in C# as an assignment

  • 0

I was tasked to make a basic Pegz game in C# as an assignment for school. The rules can be found here: http://tinyurl.com/6wro5xc. I’m not looking for a step by step how to build the game, but rather just how to get started. I’m fairly new to C# application development, but have a background in C# web development.

So far I have a flow control layout panel with a 5×5 grid of regular panels within it. Within each regular panel I have a picture box containing the image of the peg. All panels are full except one remains empty. See attached image for an example. In order to keep track of the 5×5 grid of panels I thought I would use a two dimensions BitArray that would hold the coordinates of the panel in the grid, and would be true if a peg exists or false if it does not.

My first question would be how do I go about tieing the grid to the array. In other words: how would I know that [0][0] of the array would represent the top left of the grid? I have the following constructor for the array BitArray[,] board = new BitArray[5,5]; I know that I will first have to cycle through the array and assign all but one of the values to true, but then I will need to take that data in the array and apply it to the Grid. The concept of how to bind that array to the grid is the part I am stuck at.

I appreciate any help.

enter image description here

  • 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-31T22:58:09+00:00Added an answer on May 31, 2026 at 10:58 pm

    There are undoubtedly better ideas than this one, but nonetheless here’s something to get you started…

    Instead of making an array of bits, make an array of a class you create to represent a point which will also contain methods to set/unset the point. Then you could do something like MyGrid[x][y].Set();.

    You might also look into using collections instead of arrays too. I rarely use arrays for anything anymore except low level or legacy type operations that require them.

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

Sidebar

Related Questions

I was tasked as a homework assignment to make a task tracker. I wanted
I currently was tasked to make a genogram for a family consisting of siblings,
I have been tasked with refactoring some components that used xmlbeans to now make
I have been tasked with looking into our deployments, and seeing where they can
I'm not much of a Visual Basic person, but I am tasked with maintaining
I've been tasked with doing refactoring to a Java Swing application we have here
I am tasked with changing what a delphi program does here at work. The
I'm new to python and i have been tasked to make a vertical bar
I'm tasked with building an educational game for 6 - 10 year-old children using
I have been tasked with porting a large Java codebase to the Android platform.

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.