Open emmaxshen opened 6 months ago
Your project about cyber security is really interesting. I hadn't really seen your group's project and it's interesting how we both pursued the game route for learning but ended up doing completely different things. Of course, ours is more based of APCSA circulium and is an RPG-style game. Although your code is giving me ideas on how to make little mini games for our players. I think the battle sequence that I created could get stale so maybe around the map I should add minigames similar to what you made to make the game easiser to newcommers.
Your Code looked good and it looks like it all relates to the college board exams.
3.6/4 Cool Project
Show how FRQs or principles of FRQs are incorporated into to your final project.
FRQ 1: Arrays/Array List
This FRQ was testing understanding of how to use 1D and 2D arrays in the context of iterating through them, accessing the elements, and using nested loops and conditional statements to reach the desired outcome (check whether or not elements of an array are diverse). For my group's cybersecurity educational game website, the code below functions to retrieve all game sessions for the particular game, calculate the minimum session time for each user, and return a sorted leaderboard that ranks each user by how fast they were able to complete the game.
In our code we did not explicitly use 1D or 2D arrays; however, we did use Lists and Maps in the context of Java Streams that conceptually reflect principles similar to working with 1D arrays. The
List<Gamesession> sessionList
serves as a collection, analogous to a 1D array, containing game session data. The iteration through thesessionsByUId
Map involves traversing the keys (user IDs) and their associated values (lists of game sessions), similar to iterating through a 1D array and accessing its elements. We also did use a nested for loop for each user iterates through a list of game sessions (gList
) and used a conditional if statement within this loop to check for the minimum session time.One integral part of this code that deviates from college board knowledge was our decision to use a tuple
(Tuple2<Long, Double>)
(which I learned is a built-in data type that allows you to create immutable sequences of values) since it allowed us to pair user IDs with their corresponding minimum session times in an organized bundled manner.FRQ 2: Classes
This FRQ was all about knowing what are the necessary components for a Java class which include the private instance variables, constructors, and main method. In our PBL we used this framework for many different features but most prominently we used it for the login feature. In the code segment below we declared the public class Person that holds information on their user ID, birthday, and two strings for their email and password.
Here we can see the use of a parameterized constructor that holds all of this user information to build object from the API. A custom getter method is also used to return the age of user after doing calculations from their date of birth input
I would say that the anatomy of our Person class is quite standard to other login systems with the use of some variables, constructors, and getter methods.
FRQ 3: 2D Array
This FRQ introduced the idea of sparse arrays to me. For my own understanding in simple words, I see it as a big matrix with mostly 0s and in order to not bother with all that memory you just track the nonzeros (the picture below really helped me visualize). I believe its main function is to efficiently represent and store arrays where the majority of elements have a default value.
In our project, we have not explicitly implemented any sparse or 2D arrays. However, I believe we could implement it when we complete our "spot the difference" game for phishing attack emails. When the game displays two similar images and the player's task is to identify the differences between them, we can represent these images using a 2D array of pixels. Further, as the player advances to higher levels and there are only a few differences between the two pictures we can use a sparse array to optimize storage! It could work something like this:
When the player points to a location (row, column) and claims there's a difference, you can check their input against the sparse array.
FRQ 4: Methods & Control Structures
For this one I was a bit confused on what differentiates this type of FRQ from the classes type FRQ because it seemed to just have me go through the same process of building a class, initializing instance variables an constructors, and using iterative statements to achieve the goal of figuring out if an integer was in a NumberGroup. After some google searching I learned that one way to see a difference is that: A class can implement multiple interfaces, but it can only extend a single class. If you need a class to inherit behavior from multiple sources, interfaces provide a way to achieve this.
In our project, we definitely used a public interface for the log in feature, but I thought I should highlight the use of "public interface Link extends JpaRepository<Template, Long>" in my feature that mimics when in the FRQ I did "Range implements NumberGroup". My feature was about taking user input of what kind of operating system they had and then displaying useful information about how to combat certain vulnerability issues they were facing.
Here, the code segment above showcases the use of method control structures in the context of a Spring Data JPA repository interface (Link). It extends a generic repository interface (JpaRepository) to inherit standard CRUD operations and includes a custom query method for fetching data based on the operating system name. I think this is a pretty standard way that shows the way inheritance can lead to greater code efficiency.
Overall Reflection on FRQ & PBL
Number one takeaway: By going through this process of completing each FRQ and contemplating how the learning targets are reflected in my own group's project, my number one takeaway is that although the exact same type of data structure may not have been used, there are underlying principles and more abstract concepts that are easily comparable across many different files. For example, our project may not have explicitly used 2D arrays, but I can see that we stored information, iterated through them, and manipulated the elements to achieve a certain outcome using Lists and Maps or Tuples. I think that when I try to learn a subject I tend to gravitate towards just memorizing an exact step to step tutorial of how to solve a problem, but for computer science, I definitely believe that if you take the time to truly understand the big picture logical theories of how to handle data, figuring out what data structure or method will come with time.
What I have proficiency in: I believe that I have become pretty familiar with how to build a class and all the details within such as when to declare private or public, initializing instance variables and constructors, using getter and setter methods, and a main method for testing (FRQ 2). Also I think that I have come to understand the simple manipulation of 1D and 2D arrays through the use of iterative statements (for, while, enhanced for loops, backwards loops) and pointers when wanted to compare 2 different values within an array (FRQ 1).
What I need to work on: What really stumped me the most was FRQ 3 because at first I was just totally miffed on what even is a sparse array. I definitely think when it comes to college board FRQs that provide more given code and ask to fulfill multiple conditions, I need to take the time to thoroughly annotate each condition I need to address and to just really understand what it is asking me to do before immediately coding. I found it helpful for myself to just jot down what a sparse array is in my own words (a big matrix w/mostly 0s and to not bother with all that memory you just track the nonzero) so I can better comprehend how to even start coding.
Plans for trimester 3 : As the AP exam is approaching, I want to follow this schedule: take a year's FRQ on Saturday, reflect and take notes on what I learned on Sunday, and then spend Monday-Friday working on school assigned work and drawing parallels from the FRQs I just worked on. In this way, I can ensure that I truly grasp the abstract concepts by implementing them in my PBL assignments which will not only prepare me for the exam, but also allow me to improve my actual coding efficiency and tool kit for my computer science journey in college and beyond.