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

The Archive Base Latest Questions

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

I have an assignment for my architecture class which to implement a 31 backgammon

  • 0

I have an assignment for my architecture class which to implement a 31 backgammon game in MIPS assembly, I have done alot so far, and I have been using 2 arrays to display the board, I used 0s to indicate empty fields and other numbers for example 13 to display the number of checkers currently placed in that field, there are White checkers (represented using postive numbers) and Red Checkers are represented using negative numbers from 1-15.
But when I asked my professor , he told me that he wants the board to be updated after every move and it is supposed to look like this:(note that at the beginning of the game all the checkers are placed at the end of the board which is the starting field)


                             W1
                             W2
                             W3
                             W4
                             W5
                             W6
                             |
                            W15

                            R15
                            R14
                            R13
                            R12
                            R11
                            R10
                             |
                            R1

And the above board is supposed to be updated after dice roll ,
which means Im going to have to use some sort of array to represent and move those
numbers and letters. But im really finding it confusing to implement dynamic ints and characters in a single array. Any suggestions?
Thanks Forum.

  • 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-28T06:59:12+00:00Added an answer on May 28, 2026 at 6:59 am

    You’re correct, storing both characters (R or W) and the integer value in a single array would be very difficult. Technically, you already are storing the entire representation of all the stacks of checkers in your array. If you think of the sign bit on your integer as the color of the checkers, you’ve already solved the problem. Here’s an example:

    -5 = R5
    12 = W12
    1  = W1
    -9 = R9
    

    So you see you’re already storing the color, but you’re using the sign bit instead of a character. Now all you have to do is determine if the number is signed or not and display the corresponding character before the absolute value of the number.

    for( i = 0 ; i < myArray.length ; i++ )
    {
      if( myArray[i] != 0 )
      {
            if( myArray[i] > 0 ) print( 'W' );
        elseif( myArray[i] < 0 ) print( 'R' );
    
        print( abs( myArray[i] ) );
      }
      else print( '|' );    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an assignment in a language-independent class, and part of it is using
So I am being taught assembly and we have an assignment which is to
I have an assignment from my programming class, which is very poorly worded... The
I have an assignment that requires us to implement a doubly linked list class.
I am doing my assignment in Network architecture 1, where I have to implement
I have an assignment that I'm supposed to implement the MIPS processor in C++
I have an assignment to create a GUI using MATLAB GUIDE and am having
Are there exceptions for types which can't have thier assignment operator overloaded? Specifically, I'm
For my assignment I have been assigned the task of creating a DTD for
I have currently created a C++ class for a thread safe integer which simply

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.