Question: tep 0 : The Problem: We are writing real code this week. So far, we only have a few tools in our toolbox though. Remember
tep : The Problem:
We are writing real code this week. So far, we only have a few tools in our toolbox though.
Remember what those are? Scalar math, matrix math, comparators, ifstatements, and the ability
to save output using diary and input using the editor Were going to use these tools write the
segments of code for each person in the prisoner hat riddle, but were also going to cut the total
number of people in the riddle from ten down to five. Start with the code below labeled as the
template it has the code to assign the black and white hats. However, dont use this for anything
more than figuring out how many black hats each person sees ahead. Your lab task, is to write a
block of code for each prisoner wearing a hat. That block of code must reveal what hat color the
person has, without actually looking at the known hat assignments for that person. Youre going to
follow the video almost exactly, or rather, exactly but with a smaller number of people
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
