Category: Blogs

  • Personal Project Update #1

    What Problem Am I Trying To Solve?

    The problem I am trying to solve is that many FPS players struggle to improve their aiming skills because the training tools currently available are often too general. Popular aim training programs such as Aim Lab, KovaaK’s FPS Aim Trainer, and Aimbeast provide helpful practice environments, but they are not always tailored to a specific player’s weaknesses or the situations they encounter in their games. Because of this, players can spend a lot of time practicing without actually improving the specific skills they need most.

    Who are you solving it for?

    This solution is mainly designed for FPS players who want to improve their performance but feel stuck using general training methods. Many of these players rely on online guides or videos that give broad advice rather than targeting their specific weaknesses. In addition, some players do not have access to coaching and may only have a limited amount of time to practice. Because of this, they need a training system that is efficient, flexible, and personalized to their needs.

    Definition Statement:

    Many gamers struggle to find customizable and user specific solutions to improve their aim and skills because existing resources are too general and cannot be tailored to individual situations. To address this, I am designing an application that allows users to create customizable training scenarios and simulations so they can practice specific situations in a controlled environment.

    What Research Have I Done?

    Research I have already done for this project is doing some of Unity’s tutorials as well as playing some of the current popular similar concepts.

    What Is Your Solution?

    The solution I am proposing is a desktop training simulator that allows users to design their own practice scenarios. When the program launches, users will see a simple menu with options such as “custom scenario,” “view stats,” or “find pre existing drills.” If the player selects “custom scenario,” they will be able to adjust settings such as target size, speed, number of targets, movement direction, and time limits. These settings will be controlled through sliders or simple buttons. Once the simulation begins, the player will enter a basic training environment where simple models represent targets. The player will aim and shoot using their mouse while the system records performance data such as accuracy, reaction time, and total hits. At the end of each session, the program will display a results screen that summarizes the player’s performance. This allows players to track improvement over time and identify areas where they still need practice.

    What Progress Have You Made So Far?

    In terms of development progress, I have begun planning how the application will be built using the Unity game engine. Unity provides tools that make it possible to create a simple first-person environment, track user input, and collect gameplay data. My focus so far has been understanding how to create the basic systems needed for the project, such as first-person movement, mouse aiming, and spawning targets in the environment. As well as this, I have also started to create the main background + HUD as well as made some progress on learning the usage of Unity.

    What Challenges Do You Foresee?

    Regarding challenges, I do see many that could be a obstacle in my path. My limited experience with the Unity game engine, I feel, would be my biggest issue. While Unity provides powerful tools for building interactive environments, I am still learning how to use many of its systems, such as scripting, object spawning, and building user interfaces. Because of this, some parts of the development process may take longer than I had planned as I learn how the software works and troubleshoot problems.

    Another challenge is my current lack of knowledge in certain areas of game development, especially when it comes to programming logic and data tracking. For example, accurately recording statistics like reaction time, accuracy, and session data requires understanding how to collect and process player input during gameplay. Learning how to implement these systems correctly will most likely require even more additional research and experimentation.

    What Are Your Next Steps?

    My next steps in this project will be finishing up the main base and foundation of my project. This includes creating a simple first person player controller, designing a basic background, and implementing a system that spawns targets for the player to shoot. After that, I will begin adding customization options so users can adjust settings such as target speed, size, and movement. Once these systems are working, I will add performance tracking and a results screen so players can see their statistics after each training session.

    AI Transcript

    Transcript

    This is the complete, chronological transcript of our exchange. It includes your original project pitch, my feedback and refined suggestions, and our follow-up regarding the transcript itself. You can provide this to your instructor or post it on your blog to satisfy the AI disclosure requirement.


    Full Interaction Transcript

    User: What Problem Am I Trying To Solve? The problem I am trying to solve is that many FPS players struggle to improve their aiming skills because the training tools currently available are often too general. Popular aim training programs such as Aim Lab, KovaaK’s FPS Aim Trainer, and Aimbeast provide helpful practice environments, but they are not always tailored to a specific player’s weaknesses or the situations they encounter in their games. Because of this, players can spend a lot of time practicing without actually improving the specific skills they need most. Who are you solving it for? This solution is mainly designed for FPS players who want to improve their performance but feel stuck using general training methods. Many of these players rely on online guides or videos that give broad advice rather than targeting their specific weaknesses. In addition, some players do not have access to coaching and may only have a limited amount of time to practice. Because of this, they need a training system that is efficient, flexible, and personalized to their needs. Definition Statement: Many gamers struggle to find customizable and user specific solutions to improve their aim and skills because existing resources are too general and cannot be tailored to individual situations. To address this, I am designing an application that allows users to create customizable training scenarios and simulations so they can practice specific situations in a controlled environment. What Research Have I Done? Research I have already done for this project is doing some of Unity’s tutorials as well as playing some of the current popular similar concepts.

    What Is Your Solution? The solution I am proposing is a desktop training simulator that allows users to design their own practice scenarios. When the program launches, users will see a simple menu with options such as “custom scenario,” “view stats,” or “find pre existing drills.” If the player selects “custom scenario,” they will be able to adjust settings such as target size, speed, number of targets, movement direction, and time limits. These settings will be controlled through sliders or simple buttons. Once the simulation begins, the player will enter a basic training environment where simple models represent targets. The player will aim and shoot using their mouse while the system records performance data such as accuracy, reaction time, and total hits. At the end of each session, the program will display a results screen that summarizes the player’s performance. This allows players to track improvement over time and identify areas where they still need practice. What Progress Have You Made So Far? In terms of development progress, I have begun planning how the application will be built using the Unity game engine. Unity provides tools that make it possible to create a simple first-person environment, track user input, and collect gameplay data. My focus so far has been understanding how to create the basic systems needed for the project, such as first-person movement, mouse aiming, and spawning targets in the environment. As well as this, I have also started to create the main background + HUD as well as made some progress on learning the usage of Unity. What Challenges Do You Foresee? Regarding challenges, I do see many that could be a obstacle in my path. My limited experience with the Unity game engine I feel like would be my biggest issue. While Unity provides powerful tools for building interactive environments, I am still learning how to use many of its systems, such as scripting, object spawning, and building user interfaces. Because of this, some parts of the development process may take longer then I had planned as I learn how the software works and troubleshoot problems. Another challenge is my current lack of knowledge in certain areas of game development, especially when it comes to programming logic and data tracking. For example, accurately recording statistics like reaction time, accuracy, and session data requires understanding how to collect and process player input during gameplay. Learning how to implement these systems correctly will most likely require even more additional research and experimentation. What Are Your Next Steps? My next steps in this project will be finishing up the main base and foundation of my project. This includes; creating a simple first person player controller, designing a basic background, and implementing a system that spawns targets for the player to shoot. After that, I will begin adding customization options so users can adjust settings such as target speed, size, and movement. Once these systems are working, I will add performance tracking and a results screen so players can see their statistics after each training session.

    Problem: what is the problem you’re trying to solve? Who are you solving it for? What is your definition statement? What research have you done? What evidence do you have to understand your problem and support your solution? What is your solution? What are you building? How will you test it against your definition statement? What progress have you made so far? What challenges do you forsee? What are your next steps? Are you using AI to help you? Why have you chosen to use AI? Please provide all transcripts.

    Hello, does my current blog answer all questions with good grammar and organization?

    Gemini: You have a very solid foundation here. Your writing is clear, your problem-solving logic is sound, and you’ve managed to identify a specific “pain point” (generalization vs. specialization) that resonates with the FPS community.

    To answer your question: Yes, you have addressed all the prompts. However, I have some suggestions to polish the organization and grammar to make it look even more professional.


    📋 Review & Feedback

    1. Organization & Structure

    The flow is logical, but using bolded headers that exactly match the prompts makes it easier for a reader (or instructor) to grade. I recommend merging your “Problem,” “Who,” and “Definition” into one cohesive section as the prompt suggests.

    2. Grammar & Clarity Tweaks

    • Tense Consistency: In “What Research Have I Done,” you switch between “is doing” and “playing.” It’s better to use: “My research includes completing Unity tutorials and analyzing popular existing platforms…”
    • Run-on Sentences: In the “Challenges” section, some sentences are a bit long. Breaking them up will make your concerns about “scripting” and “data tracking” stand out more.
    • Minor Typos: Change “longer then I had planned” to “longer than I had planned.”

    3. Strengthening the “Testing” Section

    The prompt asks: “How will you test it against your definition statement?” Right now, you’ve explained the features, but not the test. You should explicitly state that you will test the solution by seeing if a user can successfully recreate a specific in-game scenario (like a “CS:GO entry frag” or “Valorant flick”) using your sliders.


    ✍️ Refined Version (Suggested Edit)

    Here is a tightened version of your text with improved grammar and flow:

    The Problem & Definition

    Many FPS players struggle to improve because existing tools like Aim Lab or KovaaK’s are often too general. While helpful, they don’t always target a player’s specific mechanical weaknesses or unique in-game situations. Definition Statement: I am designing a desktop application that allows users to create highly customizable training scenarios. This provides a controlled environment to practice specific skills that general trainers overlook, solving the “one-size-fits-all” limitation of current resources.

    Research & Evidence

    My research involves a competitive analysis of current market leaders (Aim Lab, KovaaK’s, Aimbeast) to identify where their customization menus fall short. Additionally, I have been completing Unity technical tutorials to bridge the gap between my design goals and my programming capabilities.

    The Solution & Testing

    I am building a desktop simulator featuring a modular “Custom Scenario” menu. Users can manipulate variables like target size, speed, movement patterns, and time limits via a simple UI. Testing: I will validate the solution by attempting to replicate three distinct “pro-level” movement patterns within my engine. If the tool can accurately mimic these specific drills, it meets the requirement of being a “user-specific” solution.

    Progress & Challenges

    So far, I have mapped out the application architecture in Unity and begun developing the “Greybox” environment (basic player controller and mouse-look scripts). Challenges: My primary obstacle is my limited experience with C# scripting, particularly regarding data persistence (saving high scores) and dynamic object spawning. These technical hurdles will require significant troubleshooting and modular testing.

    Next Steps

    1. Finalize the core First-Person Controller.
    2. Build the “Target Spawner” script with adjustable variables.
    3. Design the UI overlay for real-time stats (Accuracy/Reaction Time).

    🤖 The “AI” Question

    You missed the final prompt: “Are you using AI to help you? Why? Provide transcripts.”

    Since we are talking right now, you should add a section like this:

    Use of AI: I am using Gemini (AI) to help me structure my project documentation, check for grammatical clarity, and brainstorm logic for my Unity scripts. I chose to use AI to ensure my project goals are articulated professionally and to help troubleshoot coding logic that is currently above my experience level. (Note: You can then copy/paste this chat history as your transcript).

    Would you like me to help you draft a basic C# script for your target spawning system to get you started on your “Next Steps”?

  • Personal Project – First Pitch

    Definition Statement:

     Many gamers struggle to find customizable and user specific solutions to improve their aim and skills as many existing resources that help with this, such as; aim labs, kovaaks, aimbeast, are too general and are not able to be tailored to individual situations. To combat this, my project will be an application that allows users to create customizable training, scenarios, and simulations that allow users to build specific situation and allow them to practice in a controlled environment.

    Who is this solution for?

    This project is designed for FPS players who are motivated to improve their performance but struggle to find a suitable training method to help themselves. These players might feel stuck because most online advice is much too general and repetitive, as well as not tailored to their specific weaknesses. Many of these players may not have access to personal coaches and have limited time to practice, so they will need an efficient and customizable way to train.

    What are some possible solutions?

    Solutions :
    1. A Mobile or Desktop App (most realistic option)

    • A training simulator where users could : 
    1. Choose game map like environments
    2. Place Targets / Bots
    3. Adjust Difficulty Settings
    4. Track Accuracy + Reaction Time
    5. Follow improvements with data collected of training

    2. Website simulator

    • A browser version that runs directly online.
    • Would be easily accessible (no downloading)
    • Conveniently shareable
    • May be performance limited.

    3. An AI Browser Extension

    • An extension that could:
    1. Anaylze gameplay footage
    2. Gives real time suggestions
    3. Suggests training based on specific user weaknesses
    • Would be very complex to create
    • Requires AI integration 

    4. A Drill Generator

    • Insteed of generating full 3D environments, I could create:

    A performance analytics tool

    A system that generates custom drills

    Stat tracking dashboard

    What would the prototype look like?

    The prototype will be a simple desktop application that opens to a compact menu with different options such as a “custom scenario”, “view stats”, or “find preexisting drills”. If a user selects for example, “custom scenario”, they will be able to adjust some basic settings like target size, speed, number of targets, movement direction, time limits, and points using sliders or buttons. Once the simulation begins, the user will enter a basic sandbox style training area with simple shapes and models that will act as targets or a piece of the environment. The player will use their mouse to aim and shoot, while the system will track accuracy, reaction time, and total hits. At the end of a time limit or when the desired bot elimination is reached, a result screen will be displayed to show performance stats so users can see their progress every session. This prototype will mainly focus on functionality over aesthetics and graphics, prioritizing more customizable and clear performance feedback, tuning more on player suitability then visuals.

    Step by Step Plan: 

    Week 1-2 (Learning and Research Week)

    • Research existing trainers such as Aim Labs, Kovaaks, Aim Beast.
    • Learn Basic Unity tutorials
    • Learn how to create and spawn objects
    • Learn Click Detection and scoring systems.

    Test:

    • Attempt to create simple scenes / environments with clickable targets
    • Test accuracy detection if possible

    Week 3-4 (Basic Prototyping Build Week)

    • Add multiple moving targets
    • Add adjustable settings (speed, size, time)
    • Add an accuracy percentage counter
    • Add a reaction speed box

    Test:

    • Test the settings individually
    • Confirm statistic updating is working
    • Fix any bugs/troubleshoot

    Week 5-6 (Custom Scenrio Builder Week)

    • Add a menu interface
    • Add customizable sliders
    • Add models (specific game models)
    • Add a start simulation button

    Test:

    • Test all new settings
    • Ensure no crashes are imminent
    • Have 2-3 people test

    Week 7-8 (Data Tracking & Improvement Week)

    • Add a performance summary page
    • Track
      • Accuracy %
      • Reaction time average
      • Hits per second
    • Comapre session results

    Test: 

    • Run multiple test sessions
    • Confirm data saving

    Week 9 (Refining & User Testing + Visuals if have time)

    • Have at least 5 people test 
    • Gather feedback
    • Improve UI
    • Fix Final bugs
    • Polish visuals + aesthetics

    Phase 5: Refinement & User Testing (Week 9)

    – Polish visuals

    – Have at least 5 people test

    – Gather feedback

    – Improve UI clarity

    – Fix bugs

  • Planetary Project #2 – Fusion

    In this project, we were tasked to create a vehicle that could navigate the exoplanet that was assigned to us. Regarding our group, we got Enceladus, an icy, sharp terrain with a freezing temperature. Due to the hazardous and ever moving surface terrain, we settled for a submarine vehicle, capable of traversing the water underneath the ice.

    Definition Statement:

    The 4 astronauts operating the vehicle need to be able to operate and traverse in cold underwater temperatures of -201.67 celsius, uneven terrain, keep stable in high pressure conditions, and stay energy efficient so the vehicle is able to travel at least 10 km at one filling of energy while not leaving a detrimental impact on the planet for future missions. 

    The test factor we chose was propulsion underwater. We connetion a fishing buoy to the body to track where it was underwater, as it would allow us to capture the speed and efficiency of the submarine with a stationary camera that wouldnt need to be submerged. During this experiment, we hoped to learn if our submarine would be able to propel itself without it floating.

    Method

    Our project brainstorming started with the plan of creating a submarine prototype. We used a whiteboard to visually represent the different ways we could prototype our vehicle as well as conditions and factors, with our final idea being a challenging conclusion of creating a submarine. We listed multiple precautions and dangers that came with this, unfortunately however, we did forget about buoyancy as a problem that would prove to be a issue.

    Test 1

    Our first test was quite uncessful, as our submarine, which mostly composed of 3D printed parts, was much too light to sink and would float to the surface, relating back to our prior mishap on buoyancy. However, our submarine was very watertight and did not let any water go through.

    After learning the pros and cons of our design proceeding the first test, we redesigned our vehicle, our design consisting of a section in the submarine that would allow water to flow into our first layer. We hoped that would help increase the weight of the submarine, as our first design was much too buoyant and would float to the surface.

    Design

    Furthermore, we also built a separate container for electronics,
    (shown below)

    this section would be much more sealed and watertight as safety was one of our top priorities. Over the course of our tests so far, we also had some issues with friction, so we decided to get a new motor, as this motor had a much higher torque than our previous one. This would hopefully overcome our problem with the force of friction. To aid with this, we also purchased lower friction tape.

    In the below images, we can see the device that we used to contain our magnets. This device would connect with our propeler outside, through a 3d printed wall,
    (shown below)

    removing the issue of water getting inside the submarine and getting into all the electronics. The two devices were connect through a strong magnetic pull, as one was connected to a rotating motor on the inside, providing the propulsion.

    The propeller design we created is actually differently designed, as the circular shape and shape of the fans would create the least amount of water resistance while rotating in the water, causing the submarine to be propelled forward.

    The figure beneath shows the device we designed to help us hold the motor in place, this absolved the worry that we had of the engine falling out of place mid test and not recieving power. As well as this, it also allowed for the motor to not move during a test and making the submarine drive out of line.

    The context that has been written are thoughts prior to our test day. When testing the submarine, we were unable to get the engine inside the submarine to properly attatch to the external engine as the force of the motor was much too strong for the magnets we had to attatch and spin. Due to the fact that we could not get the magnets to connect, we were unable to create any propulsion for our submarine to calculate and measure. However, we did test our submarines buoyancy with our new designs

    Final Test

    During our testing period, we went for the straightforward way of putting our motor into the vehicle, which was opening the lid, putting the spinning motor onto the module, and then closing the lid, trying to get the propeller attatched to the still spinning magents on the inside. The problem hastingly occured to us that the motor was spinning much too fast, generating the predicament of having the two magnets connect to each other properly. In an attempt to get them to connect, we tried to slowly rotate the outside module in sync with the magnets inside even though we knew that it would be much too difficult to rotate it as fast as it was with the motor behind the wall. We also attempted to put the motor in while the lid was spinning in the middle of the two modules, failing as the hole created for the motor was too deep, making it very difficult to pull off as it would hit fingers going in at high speeds.
    # two of our team members had already gotten their fingers injured due to this issue…
    Eventually, the motor did slow down, and we were able to get the module on, but at that moment, the battery had died inside of our vehicle, meaning our test had failed.

    After this immense fault in planning, we decided to at least test if our submarine had at least surpassed our previous issue of buoyancy with our new design. With the new design the submarine was still too buoyant, however, the submarine floated much more slowly, meaning our solution would hae worked if it was expanded more. After adding the weights, the submarine was able to fully sink to the bottom without a hitch, while sustaining the direction it was designed to face.

    Data

    Regrettably, our test had failed, as we were unable to measure any sort of propulsion or gather any info that was planned, with our definition statement being unmet. Our vehicle not moving meant that our energy efficiency was at 0%, with our input being 9V due to our battery.

    Final Anaylsis

    Despite our lack of data, we tried to make assumptions of the speed and information that we would’ve concluded with if our test had suceeded. The motor was undeniably strong enough, but would’ve conflicted with friction, causing it to slow down. The fans on the propeller were also not stable and strong enough, as the fragile 3d printed material would have fallen apart. We estimated the speed to be 1m per second.

    Using these estimations, we were able to calculate the energy efficiency of our vehicle. With an input voltage of 9 V and an estimated current of 1 A, the system power was calculated to be 9 W. Furthermore, with the assumed speed of 1m/s, and a theorized travel distance of 15-20m, the total moving time would have been around 15-20 seconds. This would result in a estimated energy input of 135J – 180J. Nonetheless, due to the several factors of water resistance, internal friction, and inefficiencies in the motor, only a partial amount of this energy would be converted into useful mechanical motion. Assuming an overall system efficiency of approximately 15%, the available mechanical energy would be in the range of 20–27 J. This evaluation tells us that while the theoretical energy supply may have been enough shorter distanced lengths, inefficiencies in propulsion and power conversion likely would prevent an effective forward motion during testing.

    Conclusion

    Ultimately, we were able to draw data from our test, and we tried our best to create a vehicle prototype despite the challenges we knew we would face. If I had another chance to design a similar vehicle, I would make sure that the innermost chamber was fully watertight. As well as this, I would also assure that we would always have full access to our electronics, this is due to the fact that when we lost access to our internal electronics before we could attach the outer engines. As well as this, since we were unable to make our submarine sink properly without added weights, I would’ve used a different material, as the thermoplastics were much too lightweight. Finally, I would’ve brainstormed much more at the very start, a consensus we all agreed on post test. Due to the lack of ideas, we had to pick an idea that was much too complicated and provided too many factors that would be difficult to overcome considering our time constraints and limited expirience. I believe these are all factors that contributed to the failed submarine of our planetary project 2.

    AI Transparency Statement:

    Ai was not used in our project.
    If there was any use of AI, I am not aware of it.

  • Robotics – Fusion

    ROBOTICS

    Introduction:

    In this project, we were tasked to create a device that demonstrates circuit building and Arduino programming.

    Device : Ultrasonic Radar

    The device functions like a simplified sonar/radar system. An ultrasonic sensor mounted on a servo sweeps from 0° to 180°, measuring distances and sending that data to a computer. A processing program then visualizes these readings on a digital radar display.

    Circuit Schematic : How does it work?

    This circuit schematic works by connecting an Arduino to both a servo motor and an HC-SR04 ultrasonic sensor so they can work together to form a scanning radar system. The servo motor is powered by the Arduino’s 5V and GND pins, and its signal wire connects to a digital pin so the Arduino can control its rotation from 0° to 180°. The ultrasonic sensor is also powered by the same 5V and ground rails, while its TRIG and ECHO pins connect to two Arduino digital pins. During operation, the Arduino sends a control pulse to the servo to set the current angle, then sends a short trigger pulse to the HC-SR04. The sensor emits an ultrasonic wave, and when the echo returns, the ECHO pin outputs a pulse whose length corresponds to the distance of the object. The Arduino measures this pulse, calculates the distance, and pairs it with the current servo angle. All components share a common power and ground, allowing the signals to work correctly. This wiring setup lets the Arduino rotate the sensor, measure distance at each angle, and send the data to a computer to be displayed on the radar interface.

    BOM (Bill of Materials)

    QuantityComponent
    1HC-SR04 Ultrasonic Sensor
    1Arduino Uno Rev3
    1SG90 180° Servo Motor
    1Breadboard
    1USB Cable
    8wires
    Code : How does it work?

    The code sets up the servo motor, the ultrasonic sensor, and the serial connection. It moves the servo in 1° increments from 0° to 180° and back, using a small delay to control sweep speed. At each angle, it triggers the HC-SR04 by sending a 10-microsecond pulse, then measures the echo return time with pulseIn(), converting that duration into centimeters using the speed-of-sound constant. Each reading is bundled into a simple formatted string such as “angle,distance.” and sent to the computer. The code then receives this stream of values, analyzes it, and stores the most recent angle and distance. It then converts each polar coordinate pair into an (x, y) location relative to the radar center, adjusting the angle so the radar sweeps correctly across a semicircle. It draws the moving green sweep line that follows the servo’s real-time position, plots red points for any detected objects within range, and gradually fades past points. Continuous serial communication ensures the display updates instantly as the servo scans, making a functioning radar.

    Code

    #include <Servo.h>

    Servo radarServo;

    const int trigPin = 2;
    const int echoPin = 3;
    const int servoPin = 4;

    long duration;
    int distance;

    void setup() {
    radarServo.attach(servoPin);

    pinMode(trigPin, OUTPUT);
    pinMode(echoPin, INPUT);

    Serial.begin(9600);
    }

    int getDistance() {
    // Trigger the ultrasonic sensor
    digitalWrite(trigPin, LOW);
    delayMicroseconds(2);
    digitalWrite(trigPin, HIGH);
    delayMicroseconds(10);
    digitalWrite(trigPin, LOW);

    // Receive the echo
    duration = pulseIn(echoPin, HIGH);

    // Convert time to distance (cm)
    distance = duration * 0.034 / 2;

    return distance;
    }

    void loop() {

    // Sweep 0° → 180°
    for (int angle = 0; angle <= 180; angle++) {
    radarServo.write(angle);
    delay(15);

    int d = getDistance();
    
    // Send data to Processing
    Serial.print(angle);
    Serial.print(",");
    Serial.print(d);
    Serial.println(".");
    
    delay(20);

    }

    // Sweep 180° → 0°
    for (int angle = 180; angle >= 0; angle–) {
    radarServo.write(angle);
    delay(15);

    int d = getDistance();
    
    Serial.print(angle);
    Serial.print(",");
    Serial.print(d);
    Serial.println(".");
    
    delay(20);

    }
    }

    Visual Representation Of Code

    The video shows how when the object is out of the sensor’s range, it will be unable to be detected.

    The sensor is placed on top of the servo, which is spinning at a 180 degrees, the radar is then able to sweep around the area in the intended radius.

    Ai was not used in this assignment

    No physical test was used in this assignment

  • PEP Assignment #1 – Fusion

    Geysers, ice, and the whitest, most reflective surface in all of the solar system dominate the small world of Enceladus. One of Saturn’s moons and its sixth-largest, Enceladus was originally discovered in 1789 by William Herschel, who observed a bright dot orbiting Saturn. Ironically, Enceladus, which measures approximately 500 km wide, was named after a giant in Greek mythology. The moon possesses many forms of water, from salty oceans to water vapor in the air, making it a possible site for potential forms of life and one to watch for extraterrestrial life sightings. Even with its far distance from Earth, Enceladus remains accessible yet interesting for observation due to its many water-related phenomena. Therefore, Enceladus has emerged as one of the most fascinating environments out there. 

    What Planet Did I Choose And Why?

    We chose Enceladus because of its specific location in the solar system, the availability of water, its accessibility, and the potential for life sightings. As this moon contains most of the chemical ingredients required for life and likely hosts hydrothermal vents that release hot, mineral-rich water into its subsurface ocean, it is a place that inspires curiosity and many questions of the unknown. Furthermore, Enceladus creates a ring of its own as it orbits Saturn, which is made up of icy particles from geysers that spread out into space and circle around the planet to partially form Saturn’s E ring. The fact that these particles can be collected for further study has contributed to the Enceladus Orbilander mission. Its goal, to explore whether the moon does, in fact, hold the power to support life, is a wonder that captivates us all.

    What Opportunities Are Presented To Us On Our New Home Planet?

    On our new home, Enceladus, the opportunities for new discoveries are endless. The possibility of finding life beyond Earth makes this location exciting and compelling, for it is something humans have long imagined and anticipated. In addition, Enceladus’ surplus of water could support potential human settlements or colonies. However, with its extreme temperatures, many tests and projects will be needed to apply new technologies to its harsh environment. Also, Enceladus offers several energy sources, including hydro power from geysers and geothermal energy, both of which could be used to sustain future settlements.

    What Challenges Do You Foresee?

    Foreseeable challenges include how to handle the extreme, freezing cold of Enceladus, among many other features that are not human-friendly. Due to the reflectivity of its surface, the moon’s temperatures drop to -201° Celsius/ -330° Fahrenheit. Enceladus has no atmosphere, meaning there is no breathable air, no pressure, and no sound. Its surface is jagged and cracked, and its terrain is constantly shifting, making navigation difficult. It also has low gravity, only around 1% that of Earth’s, so both human health and movement will be greatly affected. For humans to spend time on this moon, specialized suits and equipment will be required. Furthermore, reaching the subsurface ocean requires travelling 20–30 kilometers vertically through ice, and sunlight is very weak, approximately 100 times dimmer than on Earth. These obstacles demand up-to-date technology for assistance in order to survive, let alone live, on Enceladus. Finally, transporting materials from Earth will not be possible, so humans must be fully self-sustaining on Enceladus.

    What Implications Might There Be For Vehicle Design?

    Vehicle design on Enceladus must consider and meet the moon’s extreme conditions, with the foremost being cold resistance and heavy-duty insulation to operate properly in the moon’s freezing temperatures. Air travel will not be possible due to Enceladus’ lack of atmosphere, so all transportation must take place on the moon’s surface. Low gravity implies that vehicles could bounce, tip, or flip over more easily, and with the slippery, jagged surface, vehicle designs must focus on stability, feature strong traction, and include durable structures. Hydrogen-fueled systems could possibly act as a viable energy source for vehicles in Enceladus’ harsh environment. All in all, vehicles must be created for safety, adaptability, and reliability, as Enceladus’ terrain is especially challenging.

    How do we know what we know about your planet?  Be specific.  What research was done?  What devices were used?  How did those devices collect what data, and what conclusions can be drawn from them?  What report speaks specifically to this information?

    We know what we know about Enceladus from targeted research by the Cassini spacecraft and supporting observations from the Herschel Space Observatory. Cassini flew directly through Enceladus’ south-polar plume, where tools such as the Ion and Neutral Mass Spectrometer (INMS) and the Cosmic Dust Analyzer (CDA) collected data on gases and ice grains. INMS detected water vapor, simple organics, salts, and most importantly, molecular hydrogen (H₂), which is clear evidence of active water to rock interactions and hydrothermal processes. CDA measured the composition of plume particles, identifying salts, organic compounds, and silica nanoparticles that form only in high-temperature, alkaline environments, pointing to a chemically active subsurface ocean. UVIS and imaging instruments analyzed plume structure and gas-to-dust ratios through obscuring, while Cassini’s gravity measurements confirmed a global ocean beneath a 20–40 km ice shell. Herschel observations showed that Enceladus’ plume supplies water to Saturn’s system. Together, these data reveal a warm, alkaline, ocean world rich in organics and hydrothermal activity, conditions that make Enceladus a strong candidate for habitability. 

    AI – Transcript

    User:

    pretend you are a researcher, who is able to grasp key points and concisely summarize texts and details,
    American Association for the Advancement of Science. (2017). Cassini spacecraft finds evidence of hydrothermal activity on Enceladus. EurekAlert. https://www.eurekalert.org/news-releases/487129

    Cavalié, T., et al. (2019). A Herschel map of Saturn’s stratospheric water vapor: Delivered by the plumes of Enceladus. Astronomy & Astrophysics, 630, A87. https://www.aanda.org/articles/aa/full_html/2019/10/aa35954-19/aa35954-19.html

    European Space Agency. (2019). Cassini finds soluble organic compounds in ocean-world Enceladus. ESA Science. https://sci.esa.int/web/cassini-huygens/-/cassini-finds-soluble-organic-compounds-in-ocean-world-enceladus

    Glein, C. R., Baross, J. A., & Waite, J. H. (2015). The pH of Enceladus’ ocean. Geochimica et Cosmochimica Acta. https://arxiv.org/abs/1502.01946

    Khawaja, N., et al. (2019). Soluble organic compounds on Enceladus. ESA Science release. https://sci.esa.int/web/cassini-huygens/-/cassini-finds-soluble-organic-compounds-in-ocean-world-enceladus

    Kirchoff, M. R., Howett, C., Verbiscer, A., & Spencer, J. (2018). Cassini UVIS and VIMS observations of Enceladus’s plume. https://arxiv.org/abs/1801.01567

    NASA. (2015). Enceladus: Possible hydrothermal activity. NASA Science. https://science.nasa.gov/resource/enceladus-possible-hydrothermal-activity/

    NASA. (2025). Cassini mission to Saturn. NASA Missions. https://science.nasa.gov/mission/cassini/

    NASA Jet Propulsion Laboratory. (2024). Ion and neutral mass spectrometer (INMS). NASA. https://science.nasa.gov/mission/cassini/spacecraft/cassini-orbiter/ion-and-neutral-mass-spectrometer/

    Waite, J. H., et al. (2017). Cassini finds molecular hydrogen in the Enceladus plume: Evidence for hydrothermal processes. Science, 356 (6334), 155–159. https://pubmed.ncbi.nlm.nih.gov/28408597/

    Wenz, J. (2015). Enceladus’s hydrothermal vents could revolutionize the search for extraterrestrial life. Scientific American. https://www.scientificamerican.com/article/enceladus-s-hydrothermal-vents-could-revolutionize-the-search-for-extraterrestrial-life/

    Could you research into these sources that I found?


    Assistant:

    Here is a researcher-style synthesis of what we know today about Enceladus (the icy moon of Saturn), based on the sources you listed (and closely related follow-up studies). I’ve distilled the main findings, open questions, and implications for habitability.


    🔬 Main empirical and modeling results

    • Plumes, subsurface ocean, and hydrothermal activity

    • The Cassini spacecraft discovered towering plumes of water-ice, vapor, and materials erupting from Enceladus’s south pole.
    • Cassini detected molecular hydrogen (H₂) in the plume vapor during its deepest dive, suggesting hydrothermal reactions between hot rock and seawater.
    • Cassini also sampled nanometer-scale silica grains, indicating high-temperature hydrothermal activity (>90°C).
    • Enceladus’s rocky core is porous, allowing water–rock interaction that drives long-term hydrothermal systems.

    • Ocean chemistry: alkaline “soda-ocean” and serpentinization

    • Modeling from Cassini data shows the ocean has a very high pH (~11–12).
    • This alkalinity results from serpentinization, producing H₂ — a major energy source for potential microbes.
    • On Earth, serpentinization supports hydrothermal vent ecosystems.

    • Organic compounds — small & large

    • Cassini detected soluble organic molecules (amines, carbonyls, aromatics) in ice grains.
    • Larger macromolecular organics were also found — hundreds of atomic mass units.
    • The presence of both small and large organics suggests diverse prebiotic chemistry in the ocean.

    • Saturn’s water vapor fed by Enceladus

    • A Herschel map of Saturn’s stratosphere showed that Enceladus’s plumes supply most of the water vapor to Saturn’s atmospheric system.

    ✅ Habitability implications

    Enceladus has:

    • liquid water
    • a chemical energy source (H₂)
    • rock–water interaction
    • organic molecules

    These are the core ingredients for habitability.

    Because the plume ejects ocean material into space, Enceladus lets us sample a deep ocean world without drilling through ice.


    ⚠️ Uncertainties

    • No direct observation of vents — all evidence is indirect.
    • Ocean pH inferred from models.
    • Organic detection ≠ life detection.
    • Unknown redox balance in the ocean (availability of oxidants).

    🧪 Summary

    Enceladus is one of the strongest candidates for extraterrestrial life in the Solar System due to its global ocean, hydrothermal activity, and abundant organics.

    References

    American Association for the Advancement of Science. (2017). Cassini spacecraft finds
    evidence of hydrothermal activity on Enceladus. EurekAlert. https://www.eurekalert
    .org/news-releases/487129

    Cavalié, T., et al. (2019). A Herschel map of Saturn’s stratospheric water vapor: Delivered by
    the plumes of Enceladus. Astronomy & Astrophysics, 630, A87. https://www.aanda.
    org/articles/aa/full_html/2019/10/aa35954-19/aa35954-19.html

    European Space Agency. (2019). Cassini finds soluble organic compounds in ocean-world
    Enceladus. ESA Science. https://sci.esa.int/web/cassini-huygens/-/cassini-finds-
    soluble-organic-compounds-in-ocean-world-enceladus

    Glein, C. R., Baross, J. A., & Waite, J. H. (2015). The pH of Enceladus’ ocean. Geochimica
    et Cosmochimica Acta. https://arxiv.org/abs/1502.01946

    Khawaja, N., et al. (2019). Soluble organic compounds on Enceladus. ESA Science release.
    https://sci.esa.int/web/cassini-huygens/-/cassini-finds-soluble-organic-compounds- in-ocean-world-enceladus

    Kirchoff, M. R., Howett, C., Verbiscer, A., & Spencer, J. (2018). Cassini UVIS and VIMS
    observations of Enceladus’s plume. https://arxiv.org/abs/1801.01567

    NASA. (2015). Enceladus: Possible hydrothermal activity. NASA Science. https://science.
    nasa.gov/resource/enceladus-possible-hydrothermal-activity/

    NASA. (2025). Cassini mission to Saturn. NASA Missions. https://science.nasa.gov/
    mission/cassini/

    NASA Jet Propulsion Laboratory. (2024). Ion and neutral mass spectrometer (INMS). NASA.
    https://science.nasa.gov/mission/cassini/spacecraft/cassini-orbiter/ion-and- neutral
    -mass-spectrometer/

    Waite, J. H., et al. (2017). Cassini finds molecular hydrogen in the Enceladus plume:
    Evidence for hydrothermal processes. Science, 356 (6334), 155–159. https://pubmed
    .ncbi.nlm.nih.gov/28408597/Wenz, J. (2015).

    Enceladus’s hydrothermal vents could revolutionize the search for
    extraterrestrial life. Scientific American. https://www.scientificamerican.com/article/
    enceladus-s-hydrothermal-vents-could-revolutionize-the-search-for-extraterrestrial-life/

  • CAD – Fusion

    FUSION CAD ASSIGNMENT:

    Project showcase

    Mechanical Drawing and BOM (Bill of Materials)

    For my CAD assignment, I designed a skateboard. For this idea, I used a variety of Onshape skills, including; Sketches, Extruding, Fillets, Thickening, and Transforming.

    My model, which is a skateboard, includes wheels, a wheelbase, a main skateboard deck, and a skateboard grip.

    Sketching and extruding were by far the most simple skills, I used them to cleanly illustrate lines and to create a main structure, as well as to create depth. A tool I paired along with the sketch tool was the construction tool, this allowed me to create straight lines I could base off of when adding lines or extruding evenly.

    Another tool I used was the fillet tool, this tool allowed me to create round edges that I need to create parts such as the wheels, smooth edges, and curves.

    The transforming and mirroring tool were also major time savers while working on this project, the transforming tool allowed me to duplicate objects, allowing me to drag along the x and y axis. Mirroring specific details on round angles was also a big help, as I didn’t have to eyeball the second side to make it as close as possible.

    The wheels are connected to the wheelbases using screws, connecting the centre of the wheel to the base.

    To connect the wheels to the base and spin, the wheels have 4 identical holes drilled around the centre, allowing equal spinning and rotation while still being stable.

    After completing the design of the skateboard, I then moved towards areas of completion such as the BOM, Drawing, Dimensions, and separations of parts.

    Parts

    My Drawing included the dimensions of my skateboard and my BOM, the dimensions were a big help to see if my skateboard measurements had lined up and were viable and if they were similar in proportions of scale.

    Thank you so much for reading my blog, and I’m looking forward to my next project in Fusion 10.

  • Coding – Fusion

    My conversation with AI

    User

    Pretend you are a professional coder with a surplus of experience. How would you give a step-by-step tutorial using beginner python coding to create a typing game?

    AI

    Alright, let’s build a typing game from scratch. We’ll start simple and build it up piece by piece. The goal is to create a program that shows the user a word and then measures how quickly and accurately they can type it.


    Step 1: Choosing a Random Word

    First, our game needs a list of words to choose from. Then, it needs to pick one of those words at random for the user to type. To do this, we’ll need Python’s built-in random library.

    What do you think the first line of our Python file should be to make the random library available?

    User

    i’m not sure

    AI

    No problem. Whenever you want to use a library of pre-written code in Python, you use the import command.

    So, the very first line of our file will be: import random

    Now that we have the library, we need a list of words. How would you create a Python list named words containing a few simple strings like “house”, “something”, and “video”?

    User

    words = [“house”, “something”, “video”, “chronic”, “another” ]

    AI

    That’s a perfect list.

    Now we need to use the random library to pick one item from that list. The function we need is random.choice(). You give it a list, and it returns one random item.

    How would you use random.choice() with your words list and save the result in a variable called word_to_type?

    User

    word_to_type = random.choice(words)

    AI

    Excellent. That’s exactly right.

    Just to confirm, what would the following line of code do? print(word_to_type)

    User

    it would print a random word from my list

    AI

    You got it. That’s all for the setup. We now have a random word ready for the player.


    Step 2: The Game Loop

    Next, we need the main part of the game:

    1. Show the word to the user.
    2. Get the user’s input.
    3. Measure the time it took.

    Let’s start with the first two items. How would you print the word_to_type and then ask the user for their input, storing what they type into a variable called user_input?

    User

    i’m not too sure

    AI

    No problem. Let’s break it down.

    First, to show the user the word, we can use a print() statement. A helpful message makes the game clearer for the user. print("Type this word:", word_to_type)

    Next, to get their input, we use the input() function. We can put a little prompt inside the parentheses to show the user where to type. The program will pause and wait for them to press Enter. user_input = input("> ")

    This handles the first two parts of our game loop. Now, let’s think about timing. To measure how long something takes, we need to know the start time and the end time.

    Where in our code do you think we should record the start time?

    User

    before we ask the user for their input

    AI

    That’s exactly right. We need to grab the time right before the program waits for their input.

    And where should we record the end time?

    User

    after the program asks for their input

    AI

    You’ve got it. We record the end time as soon as the user hits Enter and the input() function finishes.


    Step 3: Measuring Time

    To get the actual time, we need another Python library called time. Just like with random, we have to import it at the top of our file. import time

    The function we’ll use is time.time(), which gives us the current time as a number.

    So, the game loop will look like this:

    1. Record start_time = time.time()
    2. Get user_input
    3. Record end_time = time.time()

    Can you try to write those three lines of code in the correct order?

    User

    print(“type this word”, word_to_type) start_time user_input = input end_time

    AI

    You have the sequence of events exactly right. Now, let’s translate that into code.

    To get the current time, we need to call the time.time() function and assign its result to our variables using =.

    It looks like this:

    • Before the input: start_time = time.time()
    • After the input: end_time = time.time()

    Putting It All Together

    Let’s look at our complete game loop code now.

    Python

    import random
    import time
    
    # --- Setup ---
    words = ["house", "something", "video", "chronic", "another"]
    word_to_type = random.choice(words)
    
    # --- Main Game Loop ---
    print("Type this word:", word_to_type)
    
    start_time = time.time()
    user_input = input("> ")
    end_time = time.time()
    

    With this, the main loop is done! We now have the original word, the user’s typed word, and the time it took.

    Now we can move on to the final part: the results. Would you like to calculate the user’s typing speed or their accuracy first?

    User

    typing speed!

    AI

    Let’s calculate the typing speed. The standard measurement for this is Words Per Minute (WPM).

    To calculate WPM, we need two pieces of information:

    1. The total time the user took to type.
    2. How many “words” they typed.

    Calculating Time

    We already have the start_time and end_time from our game loop. How would you use these two variables to find out how many seconds the user took?

    User

    i’m not too sure

    AI

    No problem. To find the time that passed between two moments, we just need to subtract the starting time from the ending time.

    How would you write that as a line of code, saving the result in a new variable called duration_seconds?

    User

    end_time = time.time() – start_time = time.time() = duration_seconds

    AI

    You’ve got all the right pieces in that line. Let’s just adjust the syntax.

    In Python, the equals sign = is used for assignment. It takes the result of the calculation on the right and stores it in the variable on the left.

    So, we first calculate the difference, and then we assign that result to our new variable: duration_seconds = end_time - start_time


    Calculating WPM

    Great, we now have the time in seconds. For our Words Per Minute formula, we’ll need to convert that into minutes.

    How would you convert duration_seconds into minutes?

    User

    duration_seconds x 60 = duration_minutes

    AI

    That’s a good thought. Let’s pause and think about the conversion.

    If 120 seconds have passed, how many minutes is that?

    User

    2

    AI

    You’ve got it. And to get that answer, did you multiply 120 by 60 or divide 120 by 60?

    User

    divide

    AI

    That’s exactly right.

    So, knowing that we need to divide, and that the variable we’re creating goes on the left of the =, how would you write the full line of code?

    (Hint: The division symbol in Python is /.)

    User

    im not too sure, could i get some help?

    AI

    Of course. The function is called len(), which is short for “length.”

    It tells you how many characters are in a string. For example, len("hello") would give you the number 5.

    How would you use len() to find the number of characters in our user_input variable?

    User

    len() = user_input

    AI

    That’s the right function! We just need to adjust how we use it.

    The variable we want to find the length of goes inside the parentheses, like this: len(user_input).

    That gives us the total number of characters. Now, remember our rule: every 5 characters count as one “word.”

    So, what’s the last mathematical step we need to do with len(user_input) to find the number_of_words?

    User

    len(user_input) = number_of_words/5

    AI

    You’ve got all the right pieces there. Let’s just flip the order.

    Remember, the variable we want to create always goes on the left side of the = sign. The calculation happens on the right.

    It should look like this: number_of_words = len(user_input) / 5


    Final WPM Calculation

    Okay, let’s put it all together. We have now calculated:

    • duration_minutes
    • number_of_words

    The formula for Words Per Minute is (Total Words Typed) / (Time in Minutes).

    How would you write the final line of code to calculate the wpm?

    User

    (len(user_input) / 5) / duration_ seconds

    AI

    That is so close! You have the structure exactly right.

    For “Words Per Minute,” should we divide by the time in seconds or the time in minutes?

    User

    minutes

    AI

    You’ve got it. We need to use our duration_minutes variable.

    Now, can you write the final line of code to calculate wpm using the variables we’ve already made: number_of_words and duration_minutes?

    User

    could i have some help?

    AI

    Of course. Let’s put the final piece together.

    We have two variables ready to go:

    • number_of_words
    • duration_minutes

    And we know the formula for Words Per Minute is Words / Time in Minutes.

    How would you write one line of code that divides number_of_words by duration_minutes and saves the answer in a new variable called wpm?

    User

    number_of_words / duration_minutes

    AI

    That’s the exact calculation we need.

    The last step is to assign that result to our wpm variable. How would you write that full line?

    User

    wpm = number_of_words / duration_minutes

    AI

    You’ve got it. That’s the final line for calculating the WPM.

    We’ve now built almost the entire game. The only thing left is to check the user’s accuracy and show them their results.


    Calculating Accuracy

    Let’s keep the accuracy calculation simple: if the user’s typed word is exactly the same as the word they were supposed to type, their accuracy is 100%. If there are any mistakes, it’s 0%.

    In Python, how do we check if two variables, like word_to_type and user_input, are exactly equal?

    User

    im not too sure

    AI

    No problem. To check if two things are equal, Python uses a double equals sign ==.

    It’s a common point of confusion, so let’s clarify:

    • A single equals sign (=) is for assignment. It says, “Put this value in this box.”
    • A double equals sign (==) is for comparison. It asks, “Are the things in these two boxes the same?” and gives back a True or False answer.

    We can use this == in an if statement to do something only when the words match. How would you write the first line of an if statement that compares word_to_type and user_input?

    User

    if word_to_type == user_input, then accuracy is 100%

    AI

    That’s the perfect logic. In Python, the syntax is just a little different.

    Instead of the word “then,” we use a colon (:) and then indent the next line to show what code belongs inside the if statement. We can also add an else: block for what to do when the condition is false.

    Here’s the structure:

    Python

    if word_to_type == user_input:
        # Code to run if they are correct
    else:
        # Code to run if they are incorrect
    

    Using this structure, how would you print “Correct!” if the words match, and “Incorrect!” if they don’t?

    User

    print. correct! if word_to_type == user_input print. incorrect! if word_to_type does not equal user_input

    AI

    That’s the right idea! Let’s just rearrange it into Python’s if/else structure. The print() command goes on the indented line after the condition.

    It looks like this:

    Python

    if word_to_type == user_input:
        print("Correct!")
    else:
        print("Incorrect!")
    

    Final Code

    That was the last piece of the puzzle. We’ve now built a complete typing game. Let’s look at the final code all together.

    Python

    import random
    import time
    
    # --- Setup ---
    words = ["house", "something", "video", "chronic", "another"]
    word_to_type = random.choice(words)
    
    # --- Main Game Loop ---
    print("--- Typing Game ---")
    print("Type this word:", word_to_type)
    
    start_time = time.time()
    user_input = input("> ")
    end_time = time.time()
    
    # --- Calculations & Results ---
    duration_seconds = end_time - start_time
    # Check if duration is not zero to avoid division by zero error
    if duration_seconds > 0:
        duration_minutes = duration_seconds / 60
        number_of_words = len(user_input) / 5
        wpm = number_of_words / duration_minutes
    else:
        wpm = 0
    
    print("--- Results ---")
    
    if word_to_type == user_input:
        print("Accuracy: Correct!")
    else:
        print("Accuracy: Incorrect!")
    
    print("Your speed:", round(wpm), "WPM")
    

    Congratulations on building a complete program from scratch! 🥳

    Now that it’s working, what’s one feature you think we could add to make the game even better?

    User

    could we add sentences?

    AI

    That’s a great idea to make the game more challenging! Let’s do it.

    To make this change, we only need to adjust two things:

    1. Our list of words needs to become a list of sentences.
    2. The variable that holds the chosen item should be updated.

    First, how would you rewrite your words list to be a new list called sentences containing two or three short sentences?

    User

    sentences = [“the quick brown fox jumped over the lazy dog”, “Sphinx of black quartz, judge my vow”]

    AI

    That’s a great list of sentences.

    Now we just need to update the code that randomly selects from that list. The old line was: word_to_type = random.choice(words)

    How would you change that line to use your new sentences list and save the result in a more descriptive variable name, like sentence_to_type?

    User

    sentence_to_type = random.choice(sentences)

    AI

    That’s it exactly. You’ve successfully upgraded the game to use sentences.

    The great thing is, the rest of our code still works perfectly:

    • The WPM calculation is based on the number of characters typed, so it handles sentences just fine.
    • The accuracy check still works for comparing a perfect match.

    Here is the complete code for your upgraded game:

    Python

    import random
    import time
    
    # --- Setup ---
    sentences = ["the quick brown fox jumped over the lazy dog", "Sphinx of black quartz, judge my vow"]
    sentence_to_type = random.choice(sentences)
    
    # --- Main Game Loop ---
    print("--- Typing Game ---")
    print("Type this sentence:", sentence_to_type)
    
    start_time = time.time()
    user_input = input("> ")
    end_time = time.time()
    
    # --- Calculations & Results ---
    duration_seconds = end_time - start_time
    # Check if duration is not zero to avoid division by zero error
    if duration_seconds > 0:
        duration_minutes = duration_seconds / 60
        # The standard for WPM is 5 characters per word
        number_of_words = len(user_input) / 5
        wpm = number_of_words / duration_minutes
    else:
        wpm = 0
    
    print("--- Results ---")
    
    if sentence_to_type == user_input:
        print("Accuracy: Correct!")
    else:
        print("Accuracy: Incorrect!")
    
    print("Your speed:", round(wpm), "WPM")
    
    

    You’ve not only built a program from scratch but also successfully modified it. That’s a huge step.

    Is there anything else you’d like to add, or would you like to start a new project?

    User

    how would we include both our sentences and words?

    AI

    That’s a great way to add more variety. We can combine both lists into one master list.

    In Python, you can add two lists together with the + operator. For example, [1, 2] + [3, 4] results in [1, 2, 3, 4].

    How would you use this to combine your words and sentences lists into a new list called typing_prompts?

    User

    typing_prompts = words + sentences

    AI

    That’s exactly right.

    Now we just have to tell our program to pick a random item from this new typing_prompts list.

    The old line was sentence_to_type = random.choice(sentences). How would you change it to use our new list and a more general variable name, like prompt_to_type?

    User

    prompt_to_type = random.choice(typing_prompts)

    AI

    You’ve got it. That’s the last change we need to make.

    With that, the game will now randomly pick either a single word or a full sentence for the user to type. The rest of the code works just as it did before.


    Final Code

    Here is the complete, final version of the game with all the improvements you added.

    Python

    import random
    import time
    
    # --- Setup ---
    words = ["house", "something", "video", "chronic", "another"]
    sentences = ["the quick brown fox jumped over the lazy dog", "Sphinx of black quartz, judge my vow"]
    
    typing_prompts = words + sentences
    prompt_to_type = random.choice(typing_prompts)
    
    
    # --- Main Game Loop ---
    print("--- Typing Game ---")
    print("Type this:", prompt_to_type)
    
    start_time = time.time()
    user_input = input("> ")
    end_time = time.time()
    
    
    # --- Calculations & Results ---
    duration_seconds = end_time - start_time
    
    if duration_seconds > 0:
        duration_minutes = duration_seconds / 60
        number_of_words = len(user_input) / 5
        wpm = number_of_words / duration_minutes
    else:
        wpm = 0
    
    print("--- Results ---")
    
    if prompt_to_type == user_input:
        print("Accuracy: Correct!")
    else:
        print("Accuracy: Incorrect!")
    
    print("Your speed:", round(wpm), "WPM")
    

    You did an amazing job, not just building a program but also thinking of ways to improve it and then implementing those changes. That’s what programming is all about.

    What are you curious about next? We could keep adding features to this game or start a brand new project.

    User

    does our final code contain the defining and calling of a function?

    AI

    That’s an excellent question that gets to the heart of how code is organized.

    Your final code is very good at calling functions, but it doesn’t define any of its own.

    Think of it like this:

    • Calling a function is like using a tool from a toolbox (e.g., using a pre-made hammer).
    • Defining a function is like building your own custom tool and putting it in the toolbox for later use.

    Calling Functions (You do this a lot!) 🧰

    Your code calls many pre-built functions to perform actions. This is a fundamental part of programming.

    Here are all the functions you call in your script:

    • random.choice(): To pick a random item from your list.
    • print(): To display text on the screen.
    • time.time(): To get the current timestamp.
    • input(): To pause the program and get input from the user.
    • len(): To get the length of the user’s input string.
    • round(): To round the final WPM to a whole number.

    Defining Functions (The next step!) 🛠️

    Your code does not define any new, custom functions. Defining a function involves using the def keyword to create a reusable block of code with its own name.

    For example, we could have defined a function to handle the WPM calculation like this:

    Python

    # This is a function DEFINITION
    def calculate_wpm(duration, text_typed):
        # This code is inside the function
        if duration <= 0:
            return 0
        
        number_of_words = len(text_typed) / 5
        minutes = duration / 60
        wpm = number_of_words / minutes
        return wpm
    
    # --- Later in the code ---
    # This is a function CALL
    final_wpm = calculate_wpm(duration_seconds, user_input)
    

    Your current code is a procedural script—it runs from top to bottom. As programs get more complex, programmers define functions to keep the code organized, avoid repetition, and make it easier to read.

    User

    is there a way to incorporate this defining function into our code?

    AI

    Yes, absolutely. Incorporating your own defined function is an excellent way to make your code more organized and readable.

    The best candidate for a function in your script is the WPM calculation logic. It’s a self-contained task: it takes in the duration and the typed text, and it produces a single result (the WPM).

    Let’s refactor the code to use a function.


    The Benefits of Using a Function Here

    • Organization: It bundles all the calculation logic into one place, keeping your main code clean.
    • Readability: The main part of your code will read like plain English (e.g., wpm = calculate_wpm(...)), making it easier to understand at a glance.
    • Reusability: If your game became more complex, you could reuse this function elsewhere without copying and pasting the code.

    How to Do It

    We’ll take the calculation block and wrap it in a function definition using def.

    1. Define the Function

    We’ll create a function named calculate_wpm that takes two inputs (parameters): the time duration and the text the user typed. The code inside the function will be your existing calculation logic. At the end, it will use return to send the final answer back.

    Python

    # --- Function Definition ---
    def calculate_wpm(duration, text_typed):
        """Calculates the words per minute."""
        if duration <= 0:
            return 0  # Use 'return' to send back an answer and exit the function
        
        number_of_words = len(text_typed) / 5
        minutes = duration / 60
        wpm = number_of_words / minutes
        return wpm # Send the final calculation back
    

    2. Call the Function in Your Main Code

    Now, the “Calculations & Results” section of your code becomes much simpler. You just need to call your new function and give it the data it needs.

    Python

    # --- Calculations & Results ---
    duration_seconds = end_time - start_time
    
    # We replaced the multi-line calculation with one clean function call
    wpm = calculate_wpm(duration_seconds, user_input)
    
    print("--- Results ---")
    # ... the rest of the code stays the same
    

    Notice how the if duration_seconds > 0: check is now handled inside the function, making the main logic even cleaner.


    The Complete Refactored Code

    Here is what your final code looks like with the custom function included. It does the exact same thing as before, but it’s better organized. ✅

    Python

    import random import time # — Function Definition — def calculate_wpm(duration, text_typed): “””Calculates the words per minute.””” if duration <= 0: return 0 number_of_words = len(text_typed) / 5 minutes = duration / 60 wpm = number_of_words / minutes return wpm # — Setup — words = [“house”, “something”, “video”, “chronic”, “another”] sentences = [“the quick brown fox jumped over the lazy dog”, “Sphinx of black quartz, judge my vow”] typing_prompts = words + sentences # — Main Game Loop — prompt_to_type = random.choice(typing_prompts) print(“— Typing Game —“) print(“Type this:”, prompt_to_type) start_time = time.time() user_input = input(“> “) end_time = time.time() # — Calculations & Results — duration_seconds = end_time – start_time wpm = calculate_wpm(duration_seconds, user_input) # Calling our new function! print(“— Results —“) if prompt_to_type == user_input: print(“Accuracy: Correct!”) else: print(“Accuracy: Incorrect!”) print(“Your speed:”, round(wpm), “WPM”)

    When conversing with this ai, I used the guiding learning tool and a strong starting question to help me learn and use these skills.

    My final Code

    import random
    import time
    
    # Function Defining
    def calculate_wpm(duration, text_typed):
        """Calculates the words per minute."""
        if duration <= 0:
            return 0
        
        number_of_words = len(text_typed) / 5
        minutes = duration / 60
        wpm = number_of_words / minutes
        return wpm
    
    # Code setup
    words = ["house", "something", "video", "chronic", "another"]
    sentences = ["the quick brown fox jumped over the lazy dog", "Sphinx of black quartz, judge my vow"]
    typing_prompts = words + sentences
    
    # Game Loop
    prompt_to_type = random.choice(typing_prompts)
    print("--- Typing Game ---")
    print("Type this:", prompt_to_type)
    
    start_time = time.time()
    user_input = input("> ")
    end_time = time.time()
    
    # Calculating and result
    duration_seconds = end_time - start_time
    wpm = calculate_wpm(duration_seconds, user_input) # Calling our new function!
    
    print("--- Results ---")
    
    if prompt_to_type == user_input:
        print("Accuracy: Correct!")
    else:
        print("Accuracy: Incorrect!")
    
    print("Your speed:", round(wpm), "WPM")

    My final code included many beginner basic python coding skills, such as module/imports, variable, data types, list operations, input output, time measurement, conditionals, defining functions, and some others.

    Code explanation

    Import :

    Import random – Allows me to access random words and choices

    Import time – Allows me to use start and stop / Timer

    Setup : 

    Words – A group of words to choose from (randomly)

    Sentences – Sentences to choose from (randomly)

    Typing_prompts – we can make a full list of random choices using the “+” feature to add the lists.

    Game Loop

    prompt_to_type = random.choice(typing_prompts): The computer picks one random sentence/word from the full master list and stores it in the prompt_to_type variable.

    print(…): The lines display the game title and the chosen prompt to the user.

    start_time = time.time(): The program records a precise timestamp right before waiting for the user to type.

    user_input = input(“> “): The program pauses and waits for the user to type something and press Enter. Whatever they type is stored in the user_input variable.

    end_time = time.time(): The instant the user presses Enter, the program records a new timestamp.

    Calculations / Timestamps

    duration_seconds = end_time – start_time: It calculates how long the user took by subtracting the start time from the end time.

    if duration_seconds > 0:: It checks to make sure time has actually passed to prevent a “division by zero” error. If it has, it performs all the WPM calculations. Otherwise, it just sets wpm to 0.

    if prompt_to_type == user_input:: It compares the original prompt with what the user typed to check for accuracy and prints the appropriate message.

    print(“Your speed:”, round(wpm), “WPM”): Finally, it displays the WPM score. It uses the round() function to make the number a clean integer before showing it to the user.

    Defining Functions

    [def]: This is the Python keyword that says, “I am now defining a new function.”

    [calculate_wpm]: This is the name I will use to refer to later in my code.

    ( ): The parentheses hold the inputs the function needs to do its job.

    duration, text_typed: These are the parameters, they are placeholders for the actual data I give the function when I call it.

    :: The colon marks the end of the definition line and the beginning of the function’s code block.

    This coding assignment has been a blast and I hope to further enhance my skills!

  • Hello world!

    Welcome to User’s blog Sites. This is your first post. Edit or delete it, then start writing!