Lab 4 - Pseudocoding & Problem-solving
Challenge
For this challenge, the professor had us practice pseudocoding before we jump into actual coding. Our tasks were to create an articulate outline of a routine that either one of us follow while the other was to create comments detailing the instructions for playing any simple game that could be coded. We picked "Bulls and Cows," a simple game about guessing numbers.
Problems
One of the few problems we ran into were our different backgrounds and experiences. It was a bit hard to decide on what outline to make when we both probably do things that the other doesn't. Another minor problem was on picking a game. As these sort of games are usually more local to our areas, the other partner would not know much about it. Thus, we had to take time to ourselves to clearly understand the rules to games we were not used to. Overall, after getting those things sorted, everything became much easier.
Results
How I Get to UCSC to Attend My ART101 Lecture:
Below is the outline for Task 1. Here, we listed a daily routine for getting to the morning lectures:
-
Wake up at 5:30 AM:
- Set up several alarms every 10 minutes before 6 AM.
-
Take a shower, preferably in 30 minutes:
- Rinse and lather with soap and shampoo.
- Dry with a towel.
- Brush my teeth.
- Floss.
- Use mouthwash.
- Skincare:
- Apply serum.
- Apply cleanser.
- Apply moisturizer.
- Haircare:
- Use a hair dryer.
- Apply hair wax.
- Prepare to leave home at 6:15 AM:
- Get dressed:
- Pick an outfit from the closet.
- Pick my shoes for the day.
- Grab my backpack.
- Go downstairs to the garage:
- Use the elevator to go to the second floor.
- Go outside of the apartment.li>
- Get in my car:
- Unlock my car with my key.
- Start the engine.
- Pluck my phone in for CarPlay.
- DRIVE!!!!!
- Get dressed:
- Arrive at Santa Cruz by 7:15 (time varies depending on traffic).
- Grab breakfast at McDonalds (or any fast food joint):
- Order online with McDonalds' app (or any food delivery app like DoorDash or GrubHub):
- Order a Sausage McMuffin.
- Coffee, no milk and sugar.
- Be at the store within the designated time.
- Pick up the order.
- Eat in my car.
- Order online with McDonalds' app (or any food delivery app like DoorDash or GrubHub):
- Arrive at UCSC:
- Enter through the main gate.
- Park at Hanh Student Service.
- Get to the morning lecture:
- Exit and lock my car.
- Walk to Classroom Unit 2.
Bulls and Cows
Below is the pseudocoding for Task 2 of the game "Bulls and Cows."
// Print out instructions // User_one enters secret number (4 digits integer) // User_two enters guessing number (loop until all digits are checked) // Check each digit: // If: it is one of the secret number digits and it is in the same position: // Add 1 point or tally to A // Else if: it is one of the secret number digits but at different position: // Add 1 point or tally to B // Else: Check next digit // Print out tallies for A and B: // If: digits are guessed correctly // Print: You win the game! // Else: prompt for another guess