Lab 4 - Pseudocoding and Problem-solving

Challenge

The challenge here was startin to think like all them weird computer nerds.

Problems

Mostly we just had some issues formatting the copy/pasted results into the shared document. Otherwise, we had maybe some low level confusion regarding the assignment requirements that we quickly resolved.

Reflection

I think this lab went well!

I actually realized that I've been retaining more coding knowledge/programmer logic than I initially thought. Which is a very good thing!

Or at least, considering the amount of time i've spent around programmers for the past four years, I think that this is probably the least amount of compensation I deserve.

(thats a joke i love you guys)

Results

Everyday Task Pseudocode


							>Ironing

								>Setting up each object component
									>Board
										>Unfold ironing board
										>Make sure its on flat surface + stable
									>Iron
										>Optional: adding water (if Iron has feature and clothes need steam)
										>Plug in/Turn on
										>Alter settings to appropriate choices
										>Allow for iron to heat up
									>Clothes
										>Make sure first clothing article is laid flat out on board neatly
								>Ironing Process
									>Repeat for every clothing item:
										>Pick up iron and lay flat on top of clothing item (where necessary/clothes are wrinkled)
											>Repeat until item is ironed out wherever necessary
												>Continuously move iron w/ consistent pressure across clothing to flatten out
												>Don’t let iron sit very long
												>Press steam button if necessary 
										>Hang up each clothing item to prevent future wrinkles
								>Take-down process
									>Unplug iron
										>Allow iron to cool down
										>Once cooled put iron away
									>Fold up Ironing board
							
						

Simple Computer Game Pseudocode



							//Connect Four
							
							>Print board before each turn
							>Accept user input
							>Validate User input
								>Check that column still has empty slots
									>Place piece on lowest empty row of column
							>Evaluate possible moves
								>Check which columns still are empty
							>Choose computer move
							>Test for win or draw situation
								>Win: four in a row, horizontally, vertically, or diagonally
								>draw : board filled up with no four in a row for either player
							
							
						

Commented Pseudocode


							// Connect Four 
							//Implementation of game
							// Author: Newton Novak
							// Date: April 23rd 2023

							//Print board before each turn
								// Loop through each row
									// Loop through each space
										// Print R (red), Y (yellow), or Space
											// Print a | between each cell
										// Print a newline at the end
										// Print a horizontal line between
							//Accept user input
								// allow user to pick a column to place their piece in
									// read over user input 
							//Validate User input
								//Check that column user entered still has empty slots
										//Loop from bottom up until empty slot is found
										//Place piece on lowest empty row of column
									//if no empty slot, this is invalid
							//have user enter new choice
								//Loop until User inputs valid input
							//Evaluate possible moves
								//loop every column left to right and check which columns still have empty slots
									//mark every lowest possible slot as a valid placement
							//Choose computer move
								//check for valid placement slots that are adjacent (vertically, horizontally, diagonally) to computers own pieces
									// place computer piece in random valid slot that is adjacent 
										// if there are no pieces already placed for computer OR 
										//if there are no valid slots adjacent to computer’s pieces
											// choose any random valid placement slot
								//end computer turn
							//Test for win or draw situation
								// after each turn, loop through board and check for win/draw conditions
									//Win: four in a row, horizontally, vertically, or diagonally
									//draw : board filled up with no four in a row for either player
										//if either condition is met, end game