Help with my code, this is a checkers game written in MIPS assembly code. The problem i'm encountering is that whatever move is input by the user it won't display that move on the board being shown, Another problem is that it is not accepting some moves despite being valid moves. Attached is a picture of the code in question as its too long to write through here and I have no clue where the error is happening in. (Won't let me upload another image so unfortunately cannot show the terminal) . But below is the project description. = Your project should be free of bugs, and should perform complex user input validation when appropriate. Grading: Your project will be given a grade out of 20 points (and counts towards 20% of your final grade for the course). The general grading rubric is as follows:
Design: (i.e., do you make good use of functions) 5 points
Correctness (i.e., no bugs): 5 points
Style (i.e., code neatness and use of good conventions) 5 points
Complexity (i.e., do you use several concepts learned in class) 5 points
Purpose: The purpose of this project is to have you demonstrate your ability to synthesize the many assembly language skills that you have developed this semester along with your understanding of CPU architecture to build a fairly complex piece of software (that is not TIC TAC TOE) at the machine level. Description: Please implement a complete and useful program in MIPS assembly language. It can be a useful routines library, a math library, a game (that is NOT TIC TAC TOE), heap management software, or anything else as long as it is sufficiently complex. Your program should consist of multiple (at least two) source files and be broken into a main function that calls several other functions. My choice for this project was the checkers game written in MIPS Assembly code. I have attached the code as an image since it won't let me write it out or attach as a file.
IN STEP 1 GIVE THE INTRODUCTION OF THE CONCEPT AND GIVE ANSWER FOR EACH PART OF THE QUESTION IN EACH DIFFERENT STEP WITH CLEAR EXPLANATION AND IN THE FINAL STEP GIVE THE WHOLE FINAL ANSWER IN JUST VERY FEW SENTENCES AND MOREOVER I NEED COMPLETE AND CLEAR ANSWER at last explain what we did in each step in just few sentences
Question:
Help with my code, this is a checkers game written in MIPS assembly code. The problem i'm encountering is that whatever move is input by the user it won't display that move on the board being shown, Another problem is that it is not accepting some moves despite being valid moves. Attached is a picture of the code in question as its too long to write through here and I have no clue where the error is happening in. (Won't let me upload another image so unfortunately cannot show the terminal) . But below is the project description. = Your project should be free of bugs, and should perform complex user input validation when appropriate. Grading: Your project will be given a grade out of 20 points (and counts towards 20% of your final grade for the course). The general grading rubric is as follows:
Design: (i.e., do you make good use of functions) 5 points
Correctness (i.e., no bugs): 5 points
Style (i.e., code neatness and use of good conventions) 5 points
Complexity (i.e., do you use several concepts learned in class) 5 points
Purpose: The purpose of this project is to have you demonstrate your ability to synthesize the many assembly language skills that you have developed this semester along with your understanding of CPU architecture to build a fairly complex piece of software (that is not TIC TAC TOE) at the machine level. Description: Please implement a complete and useful program in MIPS assembly language. It can be a useful routines library, a math library, a game (that is NOT TIC TAC TOE), heap management software, or anything else as long as it is sufficiently complex. Your program should consist of multiple (at least two) source files and be broken into a main function that calls several other functions. My choice for this project was the checkers game written in MIPS Assembly code. I have attached the code as an image since it won't let me write it out or attach as a file.
IN STEP 1 GIVE THE INTRODUCTION OF THE CONCEPT AND GIVE ANSWER FOR EACH PART OF THE QUESTION IN EACH DIFFERENT STEP WITH CLEAR EXPLANATION AND IN THE FINAL STEP GIVE THE WHOLE FINAL ANSWER IN JUST VERY FEW SENTENCES AND MOREOVER I NEED COMPLETE AND CLEAR ANSWER at last explain what we did in each step in just few sentences
This is AI generated Response.
Asked by: Test User 100229
Created at: 2025-05-10 07:38:58
Final Answer:
RenderedRaw Text
Did you like this answer?
Absolutely! Let’s break down your request into clear steps as you’ve asked:
---
## **Step 1: Introduction to the Concept**
**Checkers Game in MIPS Assembly**
Checkers (also known as draughts) is a two-player strategy board game. Implementing checkers in MIPS assembly requires managing a 2D board, tracking legal moves, handling user input, checking move validity, and displaying the board. Since MIPS is a low-level language, extra care is needed for input validation, memory management, and modular code design.
---
## **Step 2: Understanding and Diagnosing Your Problems**
**Problem 1: Board Not Updating After Move**
- **Possible Causes:**
- The code that updates the board array after a move may not be writing the new piece locations correctly.
- The display function might not be referencing the updated board state.
- The register or memory indices used to update the board may be incorrect.
**Problem 2: Valid Moves Not Accepted**
- **Possible Causes:**
- The move validation logic may be too restrictive or have logic bugs (e.g., off-by-one errors).
- The code may not be properly checking for all valid checker moves (diagonal, capturing, etc).
- Input parsing might be reading the wrong values or using wrong conventions (e.g., mixing up rows and columns).
---
## **Step 3: Step-by-Step Debugging Approach**
**A. Board Update Issue**
1. **Check the Update Logic:**
Find the part of the code responsible for moving a piece (e.g., copying the value from a source position to a destination and clearing the source). Make sure the correct memory locations or array indices are used.
2. **Check the Display Logic:**
Confirm that when displaying the board, the program reads from the same board array and that no stale data is used.
**B. Move Acceptance Issue**
1. **Trace the Move Validation:**
Locate the function or code that checks if a move is valid. Check for:
- Proper range checking (board boundaries)
- Correctly differentiating between empty and occupied spaces
- Diagonal move enforcement (for checkers)
2. **Test with Known Good Moves:**
Manually input several known valid moves and see where/if the code rejects them. Put debug prints (or use SPIM’s syscall to print values) to show the input being processed and the outcome.
**C. Input Parsing**
- Ensure the input format matches what the code expects (e.g., is the user entering "row col" or "col row"?).
- Ensure the values are interpreted in the correct order and converted to array indices correctly.
---
## **Step 4: How to Fix These Issues**
1. **Synchronize Board Update and Display:**
- Always update the board array in memory immediately after a move and before displaying.
- Confirm that both move logic and display logic use the same array address.
2. **Review Move Validation:**
- Allow diagonal forward moves for regular pieces.
- Allow captures (jumping over opponent) where possible.
- Ensure you check both the starting and ending positions for legality.
- Be careful with array indices—MIPS starts arrays at 0, not 1.
3. **Improve Input Validation:**
- Check that the input is in range.
- Validate that the move is from a spot with the player’s piece, to an empty spot.
4. **Debugging Tips:**
- Print out the board array after every move.
- Print out the values of relevant registers during validation.
---
## **Step 5: Final Summary (Very Few Sentences)**
To fix your checkers game in MIPS, ensure the board array is correctly updated after every move and the display function always reads from this array. Refine your move validation logic to accurately check all valid moves and ensure your input parsing matches the expected format. Use debug prints to trace issues and confirm that every part of the code is referencing the same memory locations.
---
## **Step 6: What We Did in Each Step (Summary)**
- **Step 1:** Introduced the problem and context of checkers in MIPS.
- **Step 2:** Diagnosed your two main issues through logical reasoning.
- **Step 3:** Gave step-by-step approaches to debug both board update and move validation.
- **Step 4:** Explained how to fix these issues with clear suggestions.
- **Step 5:** Summarized the solution in a few sentences.
- **Step 6:** Recapped each step for clarity.
---
**If you can paste or describe your input-handling and move/draw routines, I can give much more specific advice and even show exact code fixes!**
VIPSolutions focuses on clear, step‑by‑step explanations so you can learn quickly. Whether you need an AI‑generated walkthrough or a short hint to get unstuck, each solution is organized for fast reading and easy review later.
Search similar questions, compare approaches, and bookmark the best answers for revision. Our goal is simple: quick, reliable study help that feels natural—not noisy.