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:

  1. Title Screen
  2. Accept user input to start
  3. Await user input for players (players: 2)
  4. Accept user input (players: 2)
  5. Game Start
  6. Players start with 2 hands, 1 finger each
  7. Accept player 1 move
  8. Validate player 1 move
  9. <1i>Tap 1 of the opponent’s hand to add 1 finger (point) to opponent’s hand
  10. If finger # is greater than 1
  11. Then add finger # amount to opponent’s hand
  12. If player has even total # fingers, player can tap hands together to move half # fingers to other hand
  13. Player input: If finger # is 3 on one hand (3 & 1)
  14. Then add additional finger to single finger hand (2 & 2)
  15. Player input: If finger # is 4 on one hand (4 & “dead” hand)
  16. Then split into 2 fingers on each hand (2 & 2)
  17. Evaluate possible moves from player 1
  18. Accept player 2 move
  19. Validate player 2 move
  20. <1i>Tap 1 of the opponent’s hand to add 1 finger (point) to opponent’s hand
  21. If finger # is greater than 1
  22. Then add finger # amount to opponent’s hand
  23. If player has even total # fingers, player can tap hands together to move half # fingers to other hand
  24. Player input: If finger # is 3 on one hand (3 & 1)
  25. Then add additional finger to single finger hand (2 & 2)
  26. Player input: If finger # is 4 on one hand (4 & “dead” hand)
  27. Then split into 2 fingers on each hand (2 & 2)
  28. Evaluate possible moves from player 2
  29. Test of win condition
  30. If a player’s hand reaches 5 finger count
  31. Then a player loses a hand
  32. If a player reaches 0 hands
  33. Then player loses and opponent wins

Running Monster Hunter on my laptop:

  1. Startup Gaming hub
  2. Prompt user to switch graphic driver
  3. Accept user input
  4. Wait until laptop reboots
  5. Prompt user to log in laptop
  6. Accept input
  7. Prompt user MSI Afterburner
  8. User accepts MSI Afterburner
  9. Accept player 2 move
  10. Validate player 2 move
  11. User input to open Monster Hunter
  12. Accept user input
  13. User waits until the game starts up
  14. 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