Question
Your friend always throws the best holiday parties and you are so excited! Your invitation came just a bit late this year though! It starts
Your friend always throws the best holiday parties and you are so excited! Your invitation came just a bit late this year though! It starts in two hours! The envelope only has a large number 17 on it, and inside is one piece of pretty much fully transparent paper. There are markings on the paper which don't seem to make out any pattern. You know your friend is requiring each guest to present a unique password to join the party. How will you ever figure everything out? Oh wait. There are two little arrows! It must want me to fold the paper over itself at the seventeenth column! That's right in the middle of the page! Holy huge leap in logic! So what happens when I do so? Oh look! Oh hi! If the paper was thinner you would see the whole "Hi!!" is intact. I removed the doubt from the picture you see here. Here is the Excel file if you'd like to see it, print it, fold it, tow it to Golf Mill Ford... Whatever you need. That's not a password though! Oh wait... Oh... There's more. In small print font there are a whole bunch of coordinates! LIke 135 pairs of (x, y) coordinates. You think this is the real puzzle to solve! This is going to take a bit more work to get the real party password. Time's a wasting! Let's get to it! This is going to be the data set you will need to solve this problem.
Part 1 - Importing the data from the file (50% of the points for the problem) The data file contains many data points in the form of (x, y) coordinates. If x=0 then that is the left side of the paper. If y=0 then that is the top of the paper. The values increase to the right, and down, respectively. What you will need to do is open the text file, and take each (x, y) coordinate and place them into a vector of vectors. Yes you can do this! When you do this properly, you will get a vector size of 135 elements, one for each line in the text file. std::vector
Part 2 - Transforming the data from a vector of vectors, into a set of vectors (50% of the points for the problem) We now have the data in a format we can work with! Hooray! We now have to virtually fold our virtual piece of paper. Look at the piece of paper in the picture on the upper left. Column 17 was right in the middle, and has no markings there. Every point that was on the left on that line was left intact. Every point on the right of that line was transformed by the folding process! The fold obviously doesn't change the vertical position of any of the points. But notice that the fold mirrors the position of the point along the horizontal axis. Anything at x=34 transforms to x=0, anything at x=33 transforms to x=1, anything at x=19 transforms to x=15 and so forth. Create a set of vectors of integers as the coordinate vectors. For every element in the "points" vector, if the x value is less than 17, simply copy it into the "finalPoints" set. For elements with x values greater than 17, transform the x coordinate value as previously described before copying it into the "finalPoints" set. When complete, you will find there are 117 elements in the set. That's because some of the points can be found overlapping each other when they are transformed. The set only reduces down to the unique elements on the grid. If it matters to you, the set will automatically sort the points as vectors get sorted: First by x value, then by y value. std::set
newX = 34 -x; // Example of how to mirror along the x axis
Optional Part 3 - Figure out the password and Party! Party! Party! (Up to 10 points extra credit)
You've put in a ton of work trying to go to this party! At this point if you don't find a solution quickly you'll have to spend the prime hours of the weekend somewhere else. Now all you have to do is convert this bunch of points into a physical message. What password will you present to the party host? You may use any solo means necessary... programming code may be the easiest, or Excel, or a piece of graph paper... Do whatever you need to get to the party!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started