I focused on Question 1 part A here, because it was especially relevant to the part of the project I tackled... collisions , mapping, and animations in JAVA...
FRQ 1)
Write a static method arraySum that calculates and returns the sum of the entries in a specified one-dimensional array. The following example shows an array arr1 and the value returned by a call to arraySum.
In our games backend, we have created an array collisions detailing the presence of collisions on the game map. Creating a sum of these collisions, and then dividing by 1025 will give us the number of collision areas at one time. To perform this, we will have to write a method arraySum, to return the sum of the entries of a one-dimensional array, arr.
Integration into project is seen in this class :
In repo itself, but in java script (because collisions stuff I have to convert to be a web game not app)

FRQ 2)
FRQ 2 focused on classes and instance variable initialization. For this I chose to focus on the NPC/PLAYER classes that I created in our project where I initialized variables similar to the ones prompted in the frq.
Class Definition:
The class Npc extends Entity and implements MouseListener.
This means that Npc inherits from Entity and also defines behavior for handling mouse events through MouseListener.
Instance Variables:
npcImage: An Image object representing the image of the NPC.
speechText: A String representing the text that the NPC will speak.
displaySpeech: A Boolean variable indicating whether the NPC's speech should be displayed.
gamePanel: A reference to a GamePanel object. This is likely the panel where the NPC will be displayed and interacted with.
The constructor initializes the state of an Npc object.
Parameters:
- x and y: Initial coordinates of the NPC.
- speechText: The text that the NPC will speak.
- gamePanel: A reference to the GamePanel where the NPC will be displayed.
We have setters which sets the initial values for x, y, speechText, and displaySpeech.
FRQ 3)
This FRQ focused on manipulating and accessing 2D arrays

In this code example from my part of the project, I used 2D arrays to detail attack types. From here I wrote functions for testing purposes that iterated through the array to print each attack type and its corresponding information and I wrote a function to changeAttackType. When I was doing this fRQ I was able to come up with the solution because of the work I did in the gameWindow files regarding changing attack types.
FRQ 4
This FRQ was about interfaces, and implementing it in separate classes. This had definite applications in our project. When I was creating the individual characters in the game, I started with a baseline class called Entity.java.

As you can see, entity has the basic common instance variables common throughout all characters : location on the map (x, y) and speed
Then I went on to create the main player class by extending Entity. I added some unique variables such as current sprite frame. This is because the player is meant to move along the screen and implement the Key handler methods I wrote, so I needed to keep track of the sprite movements to do smooth animations.
Finally NPC class, another extension of Entity, has its own variables displaySpeech. This is because NPC have dialogue in our game, whereas no other characters do.
Reflection
FRQ 1:
Implementing the arraySum method was relatively straightforward. It involves iterating through the one-dimensional array and summing up all its elements. Writing the rowSums method was simple as it was just iterating through each row of the two-dimensional array and calculating the sum of each row. I forgot to save them in a 1d array at the end though, so next time I will read the instructions more clearly. I had trouble with c because I wrote the for loop condition itself incorrectly (syntax wise). I will review manipulation of 2d arrays for the future.
FRQ 2:
This one was my personal favorite. It took a while for me to fully understand what the problem met, but the visual was helpful.
First, I created the logic for generating hints based on the comparison between the hidden word and the guess. I knew a for loop was needed to iterate through each letter. I immediately identified that 3 conditionals were required within the for loop (if, else if, else) to address the three conditions of : letter present, letter present in wrong place, and letter not present at all.
I designed the loop, allowing players to make guesses and receive hints until they either correctly guess the hidden word or reach a maximum number of attempts.
Overall, this frq was really fun to do. It was just challenging to understand at first. Sort of like wordle!
FRQ 3:
Writing the SparseArrayEntry class was straightforward.Implementing the constructor and instance variables was also relatively simple. But I also had to ensure that the object cannot be modified after construction which I didn't see the first time I did this FRQ.
The removeColumn part took the longest time for me to create. This is because I forgot the .size() , so I was trying to figure out a way to limit the loop without it. Eventually, I remembered the ,size() but it was a reminder to me to review some of the builtis.
I was a little confused on the second bullet of the last part, the else if . Are we replacing the new col with the contents of the one before it? Are we deleting the one before it so is the new col just replacing the old one? Or will the duplicates
exist?
Overall, working on this question provided a good opportunity to apply data structure concepts to a practical problem.
FRQ 4:
Creating the NumberGroup interface was easy enough. Once I wrapped my head around what the questopn was actually asking , designing the contains method afterwards also felt relatively straightforward. Interface is just the groudwork.
Implementing the Range class was a bit more challenging. When ensuring that the range includes all integers within the specified bounds, I got the constructor and instance variables sorted out. Additionally I wrote the contains method here but I do not know if I should have.
Writing the contains method for MultipleGroups was easy as well. This was just the implementation of an enhanced for loop, and the method I wrote previously. Additionally this line is important to understand (within the for ) :
- for (NumberGroup group : groupList)
Overall, this FRQ went pretty well. This is because I had experience with interfaces, and class extension with my character classes.
I focused on Question 1 part A here, because it was especially relevant to the part of the project I tackled... collisions , mapping, and animations in JAVA...
FRQ 1)
Write a static method arraySum that calculates and returns the sum of the entries in a specified one-dimensional array. The following example shows an array arr1 and the value returned by a call to arraySum.
In our games backend, we have created an array
collisionsdetailing the presence of collisions on the game map. Creating a sum of these collisions, and then dividing by 1025 will give us the number of collision areas at one time. To perform this, we will have to write a method arraySum, to return the sum of the entries of a one-dimensional array, arr.Integration into project is seen in this class :
In repo itself, but in java script (because collisions stuff I have to convert to be a web game not app)

FRQ 2)
FRQ 2 focused on classes and instance variable initialization. For this I chose to focus on the NPC/PLAYER classes that I created in our project where I initialized variables similar to the ones prompted in the frq.
Class Definition:
The class Npc extends Entity and implements MouseListener.
This means that Npc inherits from Entity and also defines behavior for handling mouse events through MouseListener.
Instance Variables:
npcImage: An Image object representing the image of the NPC.
speechText: A String representing the text that the NPC will speak.
displaySpeech: A Boolean variable indicating whether the NPC's speech should be displayed.
gamePanel: A reference to a GamePanel object. This is likely the panel where the NPC will be displayed and interacted with.
The constructor initializes the state of an Npc object.
Parameters:
We have setters which sets the initial values for x, y, speechText, and displaySpeech.
FRQ 3)
This FRQ focused on manipulating and accessing 2D arrays

In this code example from my part of the project, I used 2D arrays to detail attack types. From here I wrote functions for testing purposes that iterated through the array to print each attack type and its corresponding information and I wrote a function to changeAttackType. When I was doing this fRQ I was able to come up with the solution because of the work I did in the gameWindow files regarding changing attack types.
FRQ 4
This FRQ was about interfaces, and implementing it in separate classes. This had definite applications in our project. When I was creating the individual characters in the game, I started with a baseline class called Entity.java.

As you can see, entity has the basic common instance variables common throughout all characters : location on the map (x, y) and speed
Then I went on to create the main player class by extending Entity. I added some unique variables such as current sprite frame. This is because the player is meant to move along the screen and implement the Key handler methods I wrote, so I needed to keep track of the sprite movements to do smooth animations.
Finally NPC class, another extension of Entity, has its own variables displaySpeech. This is because NPC have dialogue in our game, whereas no other characters do.
Reflection
FRQ 1:
Implementing the arraySum method was relatively straightforward. It involves iterating through the one-dimensional array and summing up all its elements. Writing the rowSums method was simple as it was just iterating through each row of the two-dimensional array and calculating the sum of each row. I forgot to save them in a 1d array at the end though, so next time I will read the instructions more clearly. I had trouble with c because I wrote the for loop condition itself incorrectly (syntax wise). I will review manipulation of 2d arrays for the future.
FRQ 2:
This one was my personal favorite. It took a while for me to fully understand what the problem met, but the visual was helpful.
First, I created the logic for generating hints based on the comparison between the hidden word and the guess. I knew a for loop was needed to iterate through each letter. I immediately identified that 3 conditionals were required within the for loop (if, else if, else) to address the three conditions of : letter present, letter present in wrong place, and letter not present at all.
I designed the loop, allowing players to make guesses and receive hints until they either correctly guess the hidden word or reach a maximum number of attempts.
Overall, this frq was really fun to do. It was just challenging to understand at first. Sort of like wordle!
FRQ 3:
Writing the SparseArrayEntry class was straightforward.Implementing the constructor and instance variables was also relatively simple. But I also had to ensure that the object cannot be modified after construction which I didn't see the first time I did this FRQ.
The removeColumn part took the longest time for me to create. This is because I forgot the .size() , so I was trying to figure out a way to limit the loop without it. Eventually, I remembered the ,size() but it was a reminder to me to review some of the builtis.
I was a little confused on the second bullet of the last part, the else if . Are we replacing the new col with the contents of the one before it? Are we deleting the one before it so is the new col just replacing the old one? Or will the duplicates
exist?
Overall, working on this question provided a good opportunity to apply data structure concepts to a practical problem.
FRQ 4:
Creating the NumberGroup interface was easy enough. Once I wrapped my head around what the questopn was actually asking , designing the contains method afterwards also felt relatively straightforward. Interface is just the groudwork.
Implementing the Range class was a bit more challenging. When ensuring that the range includes all integers within the specified bounds, I got the constructor and instance variables sorted out. Additionally I wrote the contains method here but I do not know if I should have.
Writing the contains method for MultipleGroups was easy as well. This was just the implementation of an enhanced for loop, and the method I wrote previously. Additionally this line is important to understand (within the for ) :
Overall, this FRQ went pretty well. This is because I had experience with interfaces, and class extension with my character classes.