Lab 4: Pseudocoding and Problem-solving
Challenge
Pseudocode an everyday task and a simple computer game.
Problems
I didnt run into any problems in this lab.
Reflection
Worked with Daisy on this lab, I think building muscle memory for coding is a great way to start. I felt that this practice was very useful.
Results
Simple Computer Game Pseudocode List:
- Title Screen
- Accept user input to start
- Await user input for players (players: 2)
- Accept user input (players: 2)
- Game Start
- Players start with 2 hands, 1 finger each
- Accept player 1 move
- Validate player 1 move <1i>Tap 1 of the opponent’s hand to add 1 finger (point) to opponent’s hand1i>
- If finger # is greater than 1
- Then add finger # amount to opponent’s hand
- If player has even total # fingers, player can tap hands together to move half # fingers to other hand
- Player input: If finger # is 3 on one hand (3 & 1)
- Then add additional finger to single finger hand (2 & 2)
- Player input: If finger # is 4 on one hand (4 & “dead” hand)
- Then split into 2 fingers on each hand (2 & 2)
- Evaluate possible moves from player 1
- Accept player 2 move
- Validate player 2 move <1i>Tap 1 of the opponent’s hand to add 1 finger (point) to opponent’s hand1i>
- If finger # is greater than 1
- Then add finger # amount to opponent’s hand
- If player has even total # fingers, player can tap hands together to move half # fingers to other hand
- Player input: If finger # is 3 on one hand (3 & 1)
- Then add additional finger to single finger hand (2 & 2)
- Player input: If finger # is 4 on one hand (4 & “dead” hand)
- Then split into 2 fingers on each hand (2 & 2)
- Evaluate possible moves from player 2
- Test of win condition
- If a player’s hand reaches 5 finger count
- Then a player loses a hand
- If a player reaches 0 hands
- Then player loses and opponent wins
Running Monster Hunter on my laptop:
- Startup Gaming hub
- Prompt user to switch graphic driver
- Accept user input
- Wait until laptop reboots
- Prompt user to log in laptop
- Accept input
- Prompt user MSI Afterburner
- User accepts MSI Afterburner
- Accept player 2 move
- Validate player 2 move
- User input to open Monster Hunter
- Accept user input
- User waits until the game starts up
- Game start
The file structure and pseudocode in the code editor.
Pseudocode
// Helwa's Simple Computer Game Pseudocode
// Sticks (finger game)
// Title Screen
//Accept user input to start
// Await user input for players (min: 2)
//Accept user input (min players: 2)
// Game start
// Accept player 1 move
// Validate player 1 move
// Evaluate possible moves from player 1
// Accept player 2 move
// Validate player 2 move
// Evaluate possible moves from player 2
// Test of win condition
// if player hand reaches to count: 4
// then hand loses
// Running Monster Hunter on my laptop
// Startup Gaming hub
// Prompt user to switch graphic driver
// Accept user input
// Wait until laptop reboots
// Prompt user to log in laptop
// Accept input
// Prompt user MSI Afterburner
// User accepts MSI Afterburner
// User input to open Monster Hunter
// Accept user input
// User waits until the game starts up
// Game start