1. State the Parenthesis theorem:\n<<set $review_questions = true>>\n*[[I got this!|Q1_A]]\n*[[I'll give it a shot|Q1_C]]\n*[[I have no fucking idea|Q1_F]]

3. Let G be a directed graph. Prove that if G contains a directed cycle, then G contains a back edge. (Hint: Use the white path theorem)\n\n*[[I got this!|Q3_A]]\n*[[I'll give it a shot|Q3_C]]\n*[[I have no fucking idea|Q3_F]]

2[[.|Really?]] Let G be a directed graph. Determine whether, at any point in Depth-First Search, there can exist an edge of kind\na) A tree edge which joins a white vertex to a gray one\nb) A forward edge which joins a gray vertex to a black vertex\n\n*[[I got this!|Q2_A]]\n*[[I'll give it a shot|Q2_C]]\n*[[I have no fucking idea|Q2_F]]

5. Modify the pseudocode for depth-first search so that it prints out every edge in the directed graph together with its type.\n\n*[[I got this!|Q5_A]]\n*[[I'll give it a shot|Q5_C]]\n*[[I have no fucking idea|Q5_F]]

"It may be that in primitive man a fresh acces of libido kindled a [[renewed burst of activity|Focus]] on the part of the [[destructive instinct|Religion]]. There are a great many questions here to which as yet [[there is no answer|New Media]]."\n<<set $understanding = $understanding - 1>>

<<if $understanding gte 8>>\n<<set $understanding = $understanding - 1>>\nGiven two vertices with different discover times, the relationship between their discover & finish times can't have the first finish before the second\n<<else>>\n<<set $understanding = $understanding - 2>>\nFor every '(', there needs to be an equal number of ')'\n<<endif>>\n[[Next-->|Q2]]

<<if $understanding gte 10>>\n<<set $understanding = $understanding + 1>>\nLet x, y be in V & d[x] < d[y]. Then, exactly 1 of the following holds.\n1. d[x] < f[x] < d[y] < f[y]\n2. d[x] < d[y] < f[y] < f[x]\n3. d[x] < d[y] < f[x] < f[y]\n<<else>>\nLet x, y be in V. Then\n1. d[x] < f[x] < d[y] < f[y]\n2. d[x] < d[y] < f[y] < f[x]\n3. d[x] < d[y] < f[x] < f[y]\n<<endif>>\n[[Next-->|Q2]]

"Oh shit dude, that's sucks! I'm sorry. I wish I oculd help out somhow, but I've got a huge exam coming up for a class that I'm barely passing" stated Caden.\n\n"It's okay, we all have our own busy lives. It was just nice to have someone to vent my emotions out to. Anyway, I'll leave you to your studies. Good luck. Bye" stated the friend.\n\n"Later" replied Caden.\n\n"Fuck, that really sucks, wish I could help out" Caden thought.\n\n"Anyway, back to business"\n\n*[[Read the book|B1]]\n*[[Do the review questions|Q1]]

<<if $understanding gte 12>>\n<<set $understanding = $understanding + 3>>\n<<set $got_thm = true>>\nLet x, y be in V & d[x] < d[y]. Then, exactly 1 of the following holds.\n1. d[x] < f[x] < d[y] < f[y]\n2. d[x] < d[y] < f[y] < f[x]\n<<else>>\n<<set $understanding = $understanding + 2>>\nLet x, y be in V & d[x] < d[y]. Then, exactly 1 of the following holds.\n1. d[x] < f[x] < d[y] < f[y]\n2. d[x] < d[y] < f[x] < f[y]\n<<endif>>\n[[Next-->|Q2]]

"Hey man, at least if I were to fail, I could say that it'd be because I simply didn't give a fuck as opposed to trying my best, but still failing because I'm a complete idiot" Caden responded.\n\n"Are you implying that I'm some kind of idiot?" Anthony concluded.\n\n"No, man, I'm sorry, I haven't been sleeping very well recently, hence the falling asleep in class. I've been working on it, but this stupid sleeping mediation just isn't doing it[[.|Really?]] Oh well" Caden stated.\n\n"It's okay, it happens. Anyway, me and some of the other guys are gonna get together to study for the test. You're welcome to join us if you'd like" proposed Anthony.\n\n*[[Join Anthony in studying for the test|Group Study]]\n*[[Go grab something to eat|Lunch]]\n*[[Head home]]

"Have fear of [[God|Focus]] & know that [[God|Physics]] is cognizant of all your actions.\n...\n[[God|Computer Science]] is cognizant of all your actions.\n...\nKnow that [[God|Mathematics]] has knowledge of all your thoughts. Therefore take heed and bear in mind that [[God|Economics]] is forgiving and lenient.\n...\nDo not forget to show kindness to each other. [[God|New Media]] observes your actions[[.|Really?]]\n...\n[[God|Computer Engineering]] is mighty and wise."\n<<set $understanding = $understanding - 1>>

The midterm comes. Caden try to get in as much last minute studying as possible. Keeping his mind fresh on the material before the test,\n<<set $understanding = $understanding + 2>>\n<<set $score = $understanding + 50>>\n<<if $score lt 0>>\n<<set $score = 0>>\n<<endif>>\n<<if ($read) and ($review_questions)>>\nDoing both the readings & the review questions that Caden's lecturer stressed heavily, he were able to review more material overall.\n<<else>>\n<<if $review_questions>>\nHaving done the review questions, Caden was able to know exactly what would be on the test, giving him a slight edge of students who didn't take that approach.\n<<else>>\n<<if ($read)>>\nSince Caden decided to do the readings, he had a conceptual advantage over students who didn't and gave him an advantage in terms of problem solving for the test.\n<<else>>\nFor whatever reason, (you sucking at this game perhaps) Caden was unable to get that much studying done & came into this test relying more on luck than anything else.\n<<endif>>\n<<endif>>\n<<endif>>\n<<if $group_study>>\nSince Caden decided to study with a group, he managed to score a <<print $score>> on the test.\n<<else>>\nCaden decided that studying by himself would be in his best interest & scored a <<print $score>> on the test.\n<<endif>>\n<<if $score gte 90>>\nCaden aced the test! After doing so, he continued to ace everything remaining in the class and his story only gets better from there. Caden was able to graduate early, near the top of his class, got a good job making video games with one of his old high school friends, and life was just awesome for him overall.\n<<else>>\n<<if $score gte 80>>\nWell, Caden got a B on the test. His efforts continued this way & he managed to get a B overall. From there, he continually strived to improve, but could never quite reach the top. Something was always holding him back. But in the end, Caden became a well-balanced person.\n<<else>>\n<<if $score gte 70>>\nCaden barely squeeked by this test & after all the effort he put in at this point just to be back at a C, Caden decided to give up his dreams of being a game designer & instead pursued a career in accounting. Caden now works a lonely office job, but gets paid something decent. Overall, I'd say he now lives an average life.\n<<else>>\n<<if $score gte 60>>\nWell Caden managed to fail the test. He got his act together in the end & barely got through the class. Unfortunately, the habits that Caden picked up from this class carried over the rest of his academic career. Just barely managing to get his degree after taking 2 more years as an undergraduate, Caden wasn't a very hot item in the job market. Any job he did find, he was treated poorly & heavily underpaid. Because financial stability was something he never achieved, Caden was single his whole life. Overall, things could've gone alot better for Caden if his academics were better (i.e. be better at the game!)\n<<else>>\nCaden completely bombed the test! This lead to inevitable failure of the class & the lack in confidence eventually led Caden to drop out of college altogether. Because Caden's confidence was completely destroyed from dropping out of college, he eventally ended up working at McDonold's for the rest of his life[[.|Really?]] Because financial stability was something he never achieved, Caden was single his whole life. Unfortunately, he cut that life short after a demotion while working at McDonold's sent him over the edge & he went postal on the entire work force killing 50, including himself, and wounding at least 70 others. (In other words, because you suck so hard at this game, you've caused 50 people to die & 70 others to be injured. Are you proud of yourself?)\n<<endif>>\n<<endif>>\n<<endif>>\n<<endif>>\n<<if $shameless_self_promotion eq 9001>>\nFor more information on //Rocket Warrior// visit: \nhttp://basketofchickens.pbworks.com/w/page/35617070/FrontPage\n<<endif>>\n[[Author's Notes]]

You clicked on a period?!?!?!?!?!? Am I just boring you to death or something? Fine then... you don't want a story, you don't get one! Actually, I'll do you one better\n<<display "FUCK YOU">>

<<if $understanding gte 9>>\n<<set $understanding = $understanding - 3>>\na) Yes\nb) Yes\n<<else>>\n<<set $understanding = $understanding - 4>>\na) Yes\nb) No\n<<endif>>\n[[Next-->|Q3]]

"Yeah I know, I really need to get my shit together. Summer classes & I aren't very compadible unfortunately" claimed Caden.\n\n"It's okay, it happens. Anyway, me and some of the other guys are gonna get together to study for the test. You're welcome to join us if you'd like" proposed Anthony.\n\n*[[Join Anthony in studying for the test|Group Study]]\n*[[Ask the lecturer about the upcoming test|Talk with lecturer]]\n*[[Head home]]

<<if $understanding gte 17>>\nSuppose G contains a directed cycle, call it C. Let x be the first vertex on C to be discovered by DFS. Let y be the predecessor of x along C. Since x is discovered first, the segment of C from x to y is an x-y path in G which is white at time d[x]. By the white path theorem, y is a descendent of x in the predecessor subgraph, therefore (y, x) is a back edge in G.\n<<else>>\n<<set $understanding = $understanding - 2>>\nSuppose G contains a directed cycle, call it C. Let x be the first vertex on C to be discovered by DFS. Let y be the predecessor of x along C. By the white path theorem, y is a descendent of x in the predecessor subgraph, therefore (y, x) is a back edge in G.\n<<endif>>\n[[Next-->|Q4]]

"Jenner's [[Law|Economics]]: If after [[working long into the night|Physics]] you think you have discovered a proof, write down the idea & without [[scrutinizing the argument|Religion]] go to bed."\n<<set $understanding = $understanding - 1>>

<<if ($understanding gte 16) and ($got_thm)>>\n<<set $understanding = $understanding + 7>>\n<<set $got_white_path = true>>\nWell, the white path theorem states that given vertices x & y on a graph G, d[x] < d[y] < f[y] < f[x] holds iff at time d[x]. G contains an x-y path consisting of white vertices. Now\nsuppose G contains a directed cycle, call it C. Let x be the first vertex on C to be discovered by DFS. Let y be the predecessor of x along C. Since x is discovered first, the segment of C from x to y is an x-y path in G which is white at time d[x]. By the white path theorem, y is a descendent of x in the predecessor subgraph, therefore, by definition of a back edge, (y, x) is a back edge in G.\n<<else>>\n<<set $understanding = $understanding - 3>>\nSuppose G contains a directed cycle, call it C. Let x be the first vertex on C to be discovered by DFS. Let y be the predecessor of x along C. By the white path, (y, x) is a back edge in G.\n<<endif>>\n[[Next-->|Q4]]

4. In C, write a Graph struct that can be used to implement Depth-First Search. Make sure that your struct has all the needed fields to run Depth-First Search & is syntactically correct.\n\n*[[I got this!|Q4_A]]\n*[[I'll give it a shot|Q4_C]]\n*[[I have no fucking idea|Q4_F]]

<<if $understanding gte 15>>\n<<set $understanding = $understanding + 1>>\n<<set $got_edges = true>>\na) Well, by definition of tree edge, we know that a tree edge only exists when we're adding a new child to our DFS forest. So, chances are that the answer should be no.\nb) Again, reverting to the definition of forward edge, our parent vertex in the forward edge will be gray while its being visited by DFS, but the child must be black (or else DFS blew it, I believe). So this is possible by definition.\n<<else>>\n<<set $understanding = $understanding + 4>>\na) Well, by definition of tree edge, we know that a tree edge only exists when we're adding a new child to our DFS forest. So, no, this case is impossible as our parent vertex would have to be gray.\nb) Again, reverting to the definition of forward edge, our parent vertex in the forward edge will be gray while its being visited by DFS, but the child can be any color. So this is possible by definition.\n<<endif>>\n[[Next-->|Q3]]

<<if $understanding gte 17>>\n<<set $understanding = $understanding - 3>>\norder\nsize\nd[]\nf[]\nparent[]\ncolor[]\nAdj[]\n<<else>>\n<<set $understanding = $understanding - 6>>\nSee the Graph struct given in the lecture notes for my answer\n<<endif>>\n[[Next-->|Q5]]

"I think I'll gonna go grab some lunch, but I might meet up with you guys later" propsed Caden.\n\n"Ok then, we'll be at Cafe Doin'Work. Hope to see you there" stated Anthony.\n\nCaden left the lecture hall & went up to the dining hall. Feeling rather boring, Caden decided to just grab a few slices of pizza & a chicken sandwich. He then sat down at at the nearest table & began eating.\n\n"Fuck, I've really been slacking in this class lately. I need to ace the shit out of this midterm. Hopefully that will get me something better than just a C in the end" claimed Caden.\n\nHe then opened up his backpack & grabbed his textbook out of it. The titled read, //Introduction to Algorithms//.\n\n"I've only got so much time until the test, but I still so burnt out from lack of sleep. What to do?" Caden thought to himself.\n<<set $lunch = true>>\n*[[Crack open the book & eat at the same time|B1]]\n*[[Finish eating & then decide|Finish Lunch]]

#snapback {display: none}

<<if $group_study>>\nCaden decides to take a quick break & refills his drink. The amount of caffeine he's consumed today proved to be too much for his body to handle & he ends up vomitting in Cafe Doin'Work because of it (Caffeine overdose?). Caden heads home immediately after this, fearing for his well-being. He attempts to sleep, but being jacked up on that much caffeine, sleep simply isn't guna happen[[.|Really?]] He tries to continue studying, but again, the caffeine wins.\n<<set $understanding = $understanding - 4>>\n\nIt's now morning & Caden heads off to the test.\n<<else>>\nCaden decides to take a quick break & play his favorite video game, Rocket Warrior. Hours & hours go by as he plays. Pwning all his online buddies as a flying robot named Mechatomodachi never gets old. Every game Caden played, he won, so it's no wonder he just got completely sucked into the game. Caden always thought that Rocket Warrior was the best game to ever exist on the Xbox Live Indie Games service & in his opinion, one better could only come from the creators of Rocket Warrior. Caden played long into the night & well into the next morning.\n\n"Oh SHIT! it's morning & I've done nothing more than read the book!!!!!!!" Caden yelled. "Fuck, looks like I'll need God on my side to make it though this one."\n<<set $understanding = $understanding - 7>>\n<<set $shameless_self_promotion = 9001>>\n<<endif>>\n[[Next-->|End]]

"[[Pipelining|Computer Engineering]] represents one of the most important aspects of the UNIX system. It implements the UNIX [[philosophy|Psychology]] that difficult [[jobs can be done by combining filters that do simple jobs in isolation.|Economics]]"\n<<set $understanding = $understanding - 1>>

"In a [[Disney|Religion]] spaceship ride you are ushered into a simulated space cabin, you hear the [[rockets|Physics]] roar, you feel vibration in the seat. But, for all this, [[there is nothing for you|Focus]] to do except [[use your imagination|Back to Start]]. In the end, the [[Disney|Religion]] ride is [[more passive than participatory drama|Psychology]]. Once again, [[designers try|Game Design]], but the media resists."\n<<set $understanding = $understanding - 1>>

Cramming-An Interactive Midterm

<<if $understanding gte 13>>\n<<set $understanding = $understanding - 4>>\nSince a digraph G is acyclic iff DFS(G) yieds no back edges, we've just given a logically equivalent and valid statement to what we're trying to prove (i.e. P <-> Q = NOT P <-> NOT Q).\n<<else>>\n<<set $understanding = $understanding - 5>>\nBy definition of a back edge, it's immidiately implied that if G contains a back edge, then G contains a directed cycle.\n<<endif>>\n[[Next-->|Q4]]

"Damn, that was some productive reading" Caden thought to himself. "I'm feeling a little beat after that. To take a break, or should I just say 'Fuck it' & jump right into the review questions?"\n*[[Take a break]]\n*[[FUCK IT|Q1]]\n<<set $understanding = $understanding + 1>>

"Since our understanding is so weak overall, my guess is that we all have significant holes in our understanding. Why don't we all crack open the books & go over what we feel we're struggling on individually" Mark proposed.\n\n"Great idea Mark! Let's do it" states Caden.\n<<set $understanding = $understanding + 1>>\n[[Next-->|B1]]

Caden eventually makes it back to the parking lot, starts up his car, & proceeds on his way home.\n\nBlasting, "What What (In The Butt)" with all the windows rolled down, Caden begins to sing,\n\n"I said what what, in the butt?\nI said what what, in the butt?\nI said what what, in the butt?\nI said what what, in the butt?\n\nYou wanna do it in my butt, in my butt?\nYou wanna do it in my butt, in my butt?\nYou wanna do it in my butt, in my butt?\nLets do it in the butt, okay..."\n<<set $understanding = $understanding - 2>>\n\nCaden soon get caught in a large patch of traffic. Appeaently someone cars exploded on the side of the road & one of the passengers died from the explosion. As tragic as this is, Caden is held up in traffic for another hour & slowly becomes more aggrivated because of it.\n[[Next-->|At Home]]

"I'm still feeling a little weak in some areas of the relevant material. I think I'll head over & study with the other guys" Caden thought.\n\nHe then headed over to Cafe Doin'Work. He purchased some beverage with enough caffeine to keep a normal person awake for a week and found Anthony & the others.\n\n"Hey guys! What'd I miss?" questioned Caden.\n\n"Nothing actually" stated Anthony. "We all got held up by some idiot who's car exploded on the side of the road, so we just got here after getting out of that mess."\n\n"Lucky me I guess, just barely avoided it" stated Caden.\n\n"Anyway, what do you guys want to start with?" questioned Anthony.\n\n"Since the entire test is based on the review sheet anyway, why would we not just go through the review sheet?" sarcastically claimed Mark, one of Anthony's other friends.\n\n"Ok then, review sheet it is. Now then, should we go through the whole thing, or just the hard stuff?" Anthony questioned.\n\n*[[Go through the whole thing|Entire Review]]\n*[[Just do the hard parts|Hard parts]]

"Utility is a measure of a consumer's [[satisfaction|Religion]] from consumption, expressed in [[units of utils|Physics]]. Consumers try to maximize their utility. A consumer's [[utility function|Mathematics]] shows the relationship between the consumption bundle and the total utility it generates."\n<<set $understanding = $understanding - 1>>

"Aight, sounds good. Let's do it!" replied Caden.\n\nCaden, Anthony & the group of other guys head over to Cafe Doin'Work, a local coffee shop. They each purchase some beverage with enough caffeine to keep a normal person awake for a week, grab a large table, plug in all their computers, and begin.\n\n"So what do you guys want to start with?" questioned Anthony.\n\n"Since the entire test is based on the review sheet anyway, why would we not just go through the review sheet?" sarcastically claimed Mark, one of Anthony's other friends.\n\n"Ok then, review sheet it is. Now then, should we go through the whole thing, or just the hard stuff?" Anthony questioned.\n\n*[[Go through the whole thing|Entire Review]]\n*[[Just do the hard parts|Hard parts]]\n<<set $group_study = true>>\n<<set $understanding = $understanding + 1>>

"Let's just do the whole thing. That was if there are any conceptual hiccups on the basics, we can iron them out right away" stated Caden[[.|Really?]]\n\n"Good idea!" replied Anthony. "So then, ...\n[[Next-->|Q1]]\n<<set $understanding = $understanding + 5>>

<<if $read>>\n"Alright, well I think I've gotten everything important out of the book that I was unsure of earlier" thought Caden.\n\nCaden's lunch had become very cold because he spent most of the time in the dining hall studying instead of eating. He then finished up his cold & unsatisfactory meal[[.|Really?]]\n\n"Hmmm... what to do now?"\n*[[Go study with the rest of the guys|Lunch to group study]]\n*[[Head home]]\n<<else>>\nCaden decided that it would be better to just take a break for a little bit & enjoy his meal. He scruffed down the pizza slices & chicken sandwich in a heart beat.\nWent back for seconds,\n...then thirds,\n...then fourths\n...\n\nHalfway through the sixth helping, Caden began to feel full & lazy. (In economics terms, you could say that his utility from consuming food has been maximized.)\n\n"Oh good God, so much food!" though Caden. "I think I'm ready to bounce, but to where?"\n<<if $understanding lte 8>>\n*[[Go study with the rest of the guys|Lunch to group study]]\n<<endif>>\n*[[Head home]]\n<<endif>>\n<<set $understanding = $understanding + 1>>\n

"Oh shit dude, that's sucks! I'm sorry. Here's an idea, I've also had a pretty sttressful day so why don't we just say, fuck it all, chill for a while & have a good time" replies Caden.\n\n"Sounds good to me, let's meet up at the bar in an hour" replies the friend.\n\n"Aight, later" states Caden.\n\n<<set $understanding = $understanding - 10>>\n\nCaden then hangs up. He meets up with his old friend at the bar. They start drinking heavily & have a good time overall. They forget their worries & hope that they can move on after such stressful days.\n\nIt gets lates & eventually, Caden drunk stumbles his way home. Being too drunk to even think of studying for the test. Caden decides it'd be better to just go to bed.\n[[Next-->|End]]

"At the start of a completely new challenge, players have to [[absorb and process a lot of information at the same time|Mathematics]]. This means their progress is slow & there is a [[big risk of frustration|Physics]]. People are often afraid of [[failure|Focus]]..."\n<<set $understanding = $understanding - 1>>

"You have four [[powerful tools|Computer Science]] at your command to develop your own creativity:\n\n~[[Faith in Your Own Creativity|Game Design]]\n~Abscence of Judgement\n~Precise Observation\n~[[Penetrating Questions|Psychology]]"\n<<set $understanding = $understanding - 1>>

Caden walks up to the lecturer of the class.\n\nHe asks, "Just to be sure I've got everything correct. The exam next class will mainly be focused on Depth-First Search & most of the questions will come from today's lecture?"\n\n"That's correct. You should know everything in the book up to this point as well as everything from lecture. Going over the review sheet will be your best friend as my tests tend to be very close to what I post on the review sheet" declares the lecturer.\n\n"Sounds good, any other tips you might be able to offer me?" Caden states.\n\n"If anything, I owuld say, try the review sheet until you get stuck on something. Figure out why you're stuck, read about it in the book, & then continue the problem. In reality, this is how you should be approaching all of your assignments" states the lecturer.\n\n"Awesome, thanks!" Caden states.\n\n<<set $understanding = $understanding + 7>>\n\n"Hmm... well most of that I could've derived on my own. But now the question is, how should I begin studying for this?" Caden thought.\n\n*[[Join Anthony in studying for the test|Group Study]]\n*[[Go grab something to eat|Lunch]]\n*[[Head home]]

<<if $understanding gte 19>>\n/*Graph class definition*/\nclass Graph {\n\n /*Order, i.e. number of vertices*/\n int order;\n\n /*Size, i.e number of edges*/\n int size;\n\n /*Parallel arrays corresponding to discover times, finish times, parents, colors,\n * & the Adjacency lists for each vertex. All for use of DFS*/\n int[] d;\n int[] f;\n int[] parent;\n int[] color;\n List[] Adj;\n}\n<<else>>\n<<set $understanding = $understanding - 2>>\ntypedef struct Graph {\n int order;\n int size;\n int* dist;\n int* parent;\n int* color;\n ListRef* Adj;\n int source;\n} Graph;\n<<endif>>\n[[Next-->|Q5]]

With this particular project, being the first interactive narrative I've written with a structure that's not a binary tree, I really wanted to explore into how interactive narrative can be used as an educational tool as opposed to a more emergent method of storytelling. In doing this, I attempted to have the educational components of this story actually reflect studying for an exam I had in my other summer class for 2011, CMPS 101. Most of the questions I derived for the review questions component of this story we're either actual review questions for the test or things that were required in written homework or programming assignments. In addition, all the segments where Caden is reading from the textbook are actually segments from the textbook for CMPS 101, Introduction to Algorithms. Video games in the past, such a Math Blaster, have attempted to be both educational as well as contain solid gameplay, but I felt that that particular mix can only work for elementary education as material becomes much too complicated at the college level for genre's that are typically considered "games" to incorperate. Since interactive narrative can be much more text-based, it felt that if I wanted to explore into making something educational at a college level, an interactive narrative would be the optimal way to begin realizing the idea.\n\nBeyond my goals with making this inherently an educational piece, in terms of structure, I felt that I mirrored the structure of games like //Heavy Rain// and //Indigo Prophecy// very well. In general, the path is somewhat linear, but the ways to traverse it vary greatly. With those games as two of my largest inspirations (to the point that I gave a presentation on //Heavy Rain// to Noah Wardrup-Fruin's, Foundations of Interactive Game Design class (CMPS 80K) in Spring 2011 which can be found <html><a href="http://classes.soe.ucsc.edu/cmps080k/Spring11/slides/80k-s11-w6-l2.pdf">here</a></html>), I guess it seemed natural for me to mirror their structure, even without intention.\n\nOf everything I learned going through this experiene, other than how to use Twine & a little bit of CSS, it would be that using tools in new & unpredictible ways is extremely challenging. Obviously, Twine wasn't intended to be an educational tool where one could program in something like a quiz & keeping track of the performance of the players. Using it in this manner became extremely time consuming as I had to manually enter the 6 different possible answers to each question based on what I thought would be common mistakes that people could make on these questions based on their understanding. Actually, programming in the understanding system also proved to be an interesting challenge because it required me to evaluate what tasks in terms of studying will actually contribute more or less to your understanding of the material as well as tasks that would make it harder to understand something, or easier to forget what you already know. I feel like I got a semi-accurate depection of typical study habits of people in this piece as well as a semi-accurate evaluation of their understanding of material. \n\nIf there was anything I wish I could change about this piece, it would be more time to add mroe interesting elements to it. Like initial concepts for any game, may things get cut from the final version. In this case, some of the things I had to cut include, actually taking the midterm (which would've been a rehash of the same questions anyway, so it was probably for the better), when choosing to only do the hard questions, just picking three at random instead of just a random starting point, elements to stimulate more than just the imagination, i.e. photos of important scenes, actually playing a video game in a certain portion, sound where relevant, etc. Perhaps, if I decide to take this to the final project level, then it can see some of these improvements.\n\nLastly, some portions of this piece occur in tandem with another piece of IF I've written titled, //Programming Hell for N00bz// which can be found <html><a href="http://people.ucsc.edu/~amccaleb/CMPE 12/lab6/lab6.asm">here</a></html>\nNote: this requires the LC-3 simulator to play. This can be downloaded from <html><a href="http://highered.mcgraw-hill.com/sites/0072467509/student_view0/lc-3_simulator.html">here</a></html>\n\nWorks Cited:\n\nCaden's Textbook,\nCormen, Thomas H. et al. __Introduction to Algorithms__, 3rd ed. Cambridge: The MIT Press, 2009.\n\nThe review sheet,\nEverything to be mentioned comes from Patrick Tantalo's notes for CMPS 101, Algorithms & Abstract Data Types, from University of California, Santa Cruz.\nQuestions 1-3 taken from Midterm 2 Review Sheet.\nQuestion 5 taken from 6th homework assignment.\nAnswers to these questions steam from those provided by Patrick Tantalo.\n\nComputer Engineering,\nPatterson, David A. and John L. Hennessy. __Computer Organization And Design: The Hardwarde/Software Interface__, 4th ed. Burlington: Morgan Kaufman Publishers, 2009.\n\nComputer Science,\nDas, Sumitabha. __Your UNIX: The Ultimate Guide__, 2nd ed. New York: McGraw-Hill, 2006.\n\nEconomics,\nKrugman, Paul, and Robin Wells. __Microeconomics__, 2nd ed. New York: Worth Publishers, 2009.\n\nGame Design,\nHabgood, Jacob, and Mark Overmars. __The Game Maker's Apprentice: Game Development for Beginners__. New York: Springer-Verlag New York Inc. 2006.\n\nMathematics,\nFletcher, Peter, and C. Wayne Patty. __Foundations of Higher Mathematics__, 3rd ed. Pacific Grove: Brooks/Cole Publishing Company, 1996.\n\nNew Media,\nWardrip-Fruin, Noah, and Nick Montfort, ed. __The New Media Reader__, Cambridge: The MIT Press. 2003.\n\nPhysics,\nBeer, Ferdinand P., et al. __Vector Mechanics for Engineers: Statics and Dynamics__, 9th ed. New York: McGraw-Hill, 2010.\n\nPsychology,\nFreud, Sigmund. __Civilization and Its Discontents: The Standard Edition__. New York: W.W. Norton & Company, Inc. 1961.\n\nReligion,\n__The Koran__; N.J. Dawood. New York: Penguin Books, 2006.\n\nStart,\nGoleman, Daniel, Paul Kaufman, and Michael Ray. __The Creative Spirit__. New York: Penguin Group, 1993.

<<if $understanding gte 21>>\n<<set $understanding = $understanding + 4>>\n/*Graph struct definition*/\ntypedef struct Graph {\n\n /*Order, i.e. number of vertices*/\n int order;\n\n /*Size, i.e number of edges*/\n int size;\n\n /*Parallel arrays corresponding to discover times, finish times, parents, colors,\n * & the Adjacency lists for each vertex. All for use of DFS*/\n int* d;\n int* f;\n int* parent;\n int* color;\n ListRef* Adj;\n} Graph;\n<<else>>\n<<set $understanding = $understanding + 2>>\ntypedef struct Graph {\n int order;\n int size;\n int* d;\n int* f;\n int* parent;\n int* color;\n ListRef* Adj;\n} Graph;\n<<endif>>\n[[Next-->|Q5]]

"The [[principle of|Economics]] virtual work for a [[particle|Game Design]] states that //if a //[[particle|Game Design]] //is in equilibrium, the total virtual work of the forces acting on the //[[particle|Game Design]] //is //[[zero|Mathematics]]// for any virtual displacement of the //[[particle|Game Design]].\n<<set $understanding = $understanding - 1>>

<<if ($understanding gte 23) and ($got_edges) and ($got_white_path)>>\n<<set $understanding = $understanding + 10>>\nWell, we know from the textbook that "when we first explore an edge (u, v), the color of vertex v tells us something about the edge:\n1. White indicates a tree edge\n2. Gray indicates a back edge, and\n3. Black indicates a forward or cross edge"\nAdditionally, from the white path theorem, we can infer that the difference between a forward & cross edge will depend on the discover times of the parent & its child. So our modification should look something like:\n\nDFS(G)\n1. for each u in V[G]\n2. color[u] = white\n3. p[u] = nil\n4. time = 0\n5. for each u in V[G]\n6. if color[u] = white\n7. Visit(u)\n\nVisit(u)\n1. color[u] = gray\n2. d[u] = time = (time+1)\n3. for all v in Adj[u]\n4. if color[v] = white\n5. print (u, v) ‘ is a Tree edge’\n6. p[v] = u\n7. Visit(v)\n8. else if color[v] = gray\n9. print (u,v) ‘ is a Back edge’\n10. else if d[u] > d[v]\n11. print (u,v) ‘ is a Cross edge’\n12. else\n13. print (u,v) ‘ is a Forward edge’\n14. color[u] = black\n15. f[u] = time = (time+1)\n<<else>>\n<<set $understanding = $understanding - 3>>\nDFS(G)\n1. for each u in V[G]\n2. color[u] = white\n3. p[u] = nil\n4. time = 0\n5. for each u in V[G]\n6. if color[u] = white\n7. Visit(u)\n8. for each u in V[G]\n9. for all v in Adj[u]\n10. if color[v] = white\n11. print (u, v) ‘ is a Tree edge’\n12. else if color[v] = gray\n13. print (u,v) ‘ is a Back edge’\n14. else if d[u] > d[v]\n15. print (u,v) ‘ is a Cross edge’\n16. else\n17. print (u,v) ‘ is a Forward edge’\n\nVisit(u)\n1. color[u] = gray\n2. d[u] = time = (time+1)\n3. for all v in Adj[u]\n4. if color[v] = white\n6. p[v] = u\n7. Visit(v)\n8. color[u] = black\n9. f[u] = time = (time+1)\n<<endif>>\n[[Finish Review]]

<<if $understanding gte 27>>\n<<set $understanding = $understanding + 4>>\nDFS(G)\n1. for each u in V[G]\n2. color[u] = white\n3. p[u] = nil\n4. time = 0\n5. for each u in V[G]\n6. if color[u] = white\n7. Visit(u)\n\nVisit(u)\n1. color[u] = gray\n2. d[u] = time = (time+1)\n3. for all v in Adj[u]\n4. if color[v] = white\n5. print (u, v) ‘ is a Tree edge’\n6. p[v] = u\n7. Visit(v)\n8. else if color[v] = gray\n9. print (u,v) ‘ is a Back edge’\n10. else if d[u] > d[v]\n11. print (u,v) ‘ is a Cross edge’\n12. else\n13. print (u,v) ‘ is a Forward edge’\n14. color[u] = black\n15. f[u] = time = (time+1)\n<<else>>\n<<set $understanding = $understanding + 2>>\nDFS(G)\n1. for each u in V[G]\n2. color[u] = white\n3. p[u] = nil\n4. time = 0\n5. for each u in V[G]\n6. if color[u] = white\n7. Visit(u)\n\nVisit(u)\n1. color[u] = gray\n2. d[u] = time = (time+1)\n3. for all v in Adj[u]\n4. if color[v] = white\n5. print (u, v) ‘ is a Tree edge’\n6. p[v] = u\n7. Visit(v)\n8. else\n9. print (u,v) ‘ isn't a Tree edge’\n10. color[u] = black\n11. f[u] = time = (time+1)\n<<endif>>\n[[Finish Review]]

<<if $understanding gte 11>>\na) No\nb) No since a black vertex indicates that we're completely done with it\n<<else>>\n<<set $understanding = $understanding - 2>>\na) Yes\nb) Yes\nThis is the case since we aren't concerned with whether the graph is directed or not\n<<endif>>\n[[Next-->|Q3]]

<<if $understanding gte 20>>\n<<set $understanding = $understanding - 5>>\nDFS(G)\n1. for each u in V[G]\n2. color[u] = white\n3. p[u] = nil\n4. time = 0\n5. for each u in V[G]\n6. if color[u] = white\n7. Visit(u)\n\nVisit(u)\n1. color[u] = gray\n2. d[u] = time = (time+1)\n3. for all v in Adj[u]\n4. if color[v] = white\n6. p[v] = u\n7. Visit(v)\n8. color[u] = black\n9. f[u] = time = (time+1)\n<<else>>\n<<set $understanding = $understanding - 7>>\nDFS(G)\n1. for all x in V(G)\n2. color[x] <- w\n3. d[x] <- INF\n4. P[x] <- null\n5. color[s] <- g\n6. d[s] <- 0\n7. Q <- Empty\n8. Q.Enqueue(Q, s)\n9. while Q != empty\n10. x <- Q.Dequeue\n11. for all y in adj[x]\n12. if color[y] = w\n13. color[y] = g\n14. d[y] = d[x] + 1\n15. P[y] = x\n16. Q.Enqueue(y)\n17. color[x] = b\n<<endif>>\n[[Finish Review]]

"You have four [[powerful tools|Computer Science]] at your command to develop your own creativity:\n\n~[[Faith in Your Own Creativity|Game Design]]\n~Abscence of Judgement\n~Precise Observation\n~[[Penetrating Questions|Psychology]]"\n<<set $understanding = 10>>

After a miserable hour in traffic, Caden finally makes it home. Just getting out of the car, Caden thinks to himself, "Holy shit, that was awful! Ugh, let's just get through the rest of the day."\n\nWalking into his house, Caden's phone rings. He answers it[[.|Really?]] It's one of Caden's oldest friends.\n\n"Hey Caden!" says the friend in a saddened voice.\n\n"Hey man, you sound a little down, what's up?" questions Caden.\n\n"I've had the shittiest day ever. Basically, I went into work today & they demoted me for no good reason. I was so heartbroken by this that I ended up crying like a baby in front of my managers & even pissed myself in public. I really need someone to help me cope with this" states the friend.\n\n*[[Comfort your friend|Comfort friend]]\n*[[Tell him that you've got your own problems|Focus on self]]\n<<set $home = true>>

"... and it looks like I'm just about out of time. In that case, remember that we have a midterm next class. Be sure to study what's on the review sheet I've provided online. Feel free to ask myself of the TA any questions. Also, reminder that your fourth assignment has been extended another two days to give you more time to prepare for the midterm. Anyway, see you all next class and good luck with studying." stated the lecturer.\n\nJust now waking up, Caden reacts, "Oh shit... slept through yet another lecture."\n\n"You know, there's really no point in coming to class if you're just going to sleep through it. Is it any wonder to you that you're on the verge of failing this class?" Anthony retorted.\n\n*[[Spiteful response]]\n*[[Accepting response]]\n*[[No response|Head home]]

<<if $group_study>>\n"Damn, that took awhile. Let's see how we did" stated Caden.\n\n"Looks like our overall understanding is: <<print $understanding>>"\n<<if $understanding gte 40>>\n"We're gonna ace the crap out of this test!"\n<<else>>\n<<if $understanding gte 30>>\n"There's a few things we should probably work on, but we're definitely doing better than the rest of the class."\n<<else>>\n<<if $understanding gte 20>>\n"If we were to go in right now, we'd at least pass, albeit, not by much."\n<<else>>\n<<if $understanding gte 10>>\n"We probably need to either [[go through that again|Q1]], or [[try something else|To read]] because I don't think I got much out of it."\n<<else>>\nWe're FUCKED!\n<<endif>>\n<<endif>>\n<<endif>>\n<<endif>>\n<<else>>\n"Damn, that took awhile. Let's see how I did" stated Caden.\n\n"Looks like my overall understanding is: <<print $understanding>>"\n<<if $understanding gte 40>>\n"I'm gonna ace the crap out of this test!"\n<<else>>\n<<if $understanding gte 30>>\n"There's a few things I should probably work on, but I'm definitely doing better than the rest of the class."\n<<else>>\n<<if $understanding gte 20>>\n"If I were to go in right now, I'd at least pass, albeit, not by much."\n<<else>>\n<<if $understanding gte 10>>\n"I probably need to either [[go through that again|Q1]], or [[try something else|B1]] because I don't think I got much out of it."\n<<else>>\nI'm FUCKED!\n<<endif>>\n<<endif>>\n<<endif>>\n<<endif>>\n<<endif>>\n[[Next-->|End]]

"Something tells me that that will be a HUGE part of the test. Better committ all that to memory" though Caden.\n\nHe continued to skim through until another interesting note caught his eye.\n\n"We can define four edge types in terms of the depth-first forest produced by a depth-first search on G:\n\n1. //Tree edges// are edges in the depth-ﬁrst forest G. Edge (u, v) is a tree edge if v was ﬁrst discovered by exploring edge (u, v).\n\n2. //Back edges// are those edges (u, v) connecting a vertex u to an ancestor v in a depth-ﬁrst tree. We consider self-loops, which may occur in directed graphs, to be back edges.\n\n3. //Forward edges// are those nontree edges (u, v) connecting a vertex u to a descendant v in a depth-ﬁrst tree.\n\n4. //Cross edges// are all other edges. They can go between vertices in the same depth-ﬁrst tree, as long as one vertex is not an ancestor of the other, or they can go between vertices in different depth-ﬁrst trees.\n\n...\n\nThe DFS algorithm has enough information to classify some edges as it encounters them. The key idea is that when we ﬁrst explore an edge (u, v), the color of vertex v tells us something about the edge:\n1. WHITE indicates a tree edge,\n2. GRAY indicates a back edge, and\n3. BLACK indicates a forward or cross edge."\n<<set $understanding = $understanding + 5>>\n<<if ($lunch) and (not $home)>>\n[[Finish Lunch]]\n<<else>>\n[[Finish Reading]]\n<<endif>>

"... in addition to a forwarding unit, [[we need|Focus]] a //hazard detection unit//[[.|Really?]] It operates during the ID stage so that it can insert the [[stall|Focus]] between the load and its use. Checking for load instructions, the control [[for|Focus]] the hazard detection unit is this single condition:\nif (ID/EX.MemRead and\n ((ID/EX.RegisterRt = IF/ID.RegisterRs) [[or|Focus]]\n (ID/EX.RegisterRt = IF/ID.RegisterRt)))\n [[stall the pipeline|Computer Science]]"\n<<set $understanding = $understanding - 1>>

"Let's just do the hard stuff & then the easy stuff should follow from that" claimed Caden.\n\n"Fair enough" replied Anthony, "So then..."\n<<set $review_questions = true>>\n<<set $understanding = $understanding + 3>>\n<<set $first_question = Math.round(Math.random() * 4) + 1>>\n<<if $first_question eq 1>>\n\n\n\n\n[[Next-->|Q1]]\n<<endif>>\n<<if $first_question eq 2>>\n\n\n\n[[Next-->|Q2]]\n<<endif>>\n<<if $first_question eq 3>>\n\n\n[[Next-->|Q3]]\n<<endif>>\n<<if $first_question eq 4>>\n\n[[Next-->|Q4]]\n<<endif>>\n<<if $first_question eq 5>>\n[[Next-->|Q5]]\n<<endif>>

<<if $lunch>>\n"Studying as much as possible would probably be the best thing for me right now" thought Caden.\n<<endif>>\n\nCaden opened up his textbook to Chapter 22, skipped over the first 10 pages feeling like he's gotten a legitimate understanding of those parts & begins reading.\n\n"The following pseudocode is the basic depth-ﬁrst-search algorithm. The input graph G may be undirected or directed. The variable time is a global variable that we use for timestamping\n\nDFS(G)\n1. for each u in V[G]\n2. color[u] = white\n3. p[u] = nil\n4. time = 0\n5. for each u in V[G]\n6. if color[u] = white\n7. Visit(u)\n\nVisit(u)\n1. color[u] = gray\n2. d[u] = time = (time+1)\n3. for all v in Adj[u]\n4. if color[v] = white\n6. p[v] = u\n7. Visit(v)\n8. color[u] = black\n9. f[u] = time = (time+1)"\n<<set $read = true>>\n<<set $understanding = $understanding + 1>>\n[[Next-->|B2]]\n<<if ($understanding gte 12)>>\n<<if ($lunch) and (not $home)>>\n[[Finish Lunch]]\n<<else>>\n[[Finish Reading]]\n<<endif>>\n<<endif>>

"DFS pseudocode. Well if I can't get this right on the test, then I'm basically doomed from the start" Caden thought.\n\nHe flipped a few more pages until he came up to what seemed like another important note:\n\n"Another important property of depth-first search is that discovery and finishing times have //parenthesis structure//. If we represent the discovery of vertex u with a left parenthesis "(u" and represent its finishing by a right parenthesis "u)", then the history of discoveries and finishings makes a well-formed expression in the sense that the parenthesis are properly nested.... The following thoerem provides another way to characterize the parenthesis structure\n\n''//The Parenthesis theorem//''\nIn any depth-first search of a (directed or undirected) graph G = (V, E), for any tow vertices u & v, exactly one of the following three conditions holds:\n~the intervals [u.d, u.f] and [v.d, v.f] are entirely disjoint, and neither u nor v is a descendant of the other in the depth-first forest,\n~the interval [u.d, u.f] is contained entirely within the interval [v.d, v.f], and u is a descendant of v in a depth-first tree, or\n~the interval [v.d, v.f] is contained entirely within the interval [u.d, u.f], and v is a descendant of u in a depth-first tree."\n<<set $understanding = $understanding + 2>>\n[[Next-->|B3]]\n<<if $understanding gte 15>>\n<<if ($lunch) and (not $home)>>\n[[Finish Lunch]]\n<<else>>\n[[Finish Reading]]\n<<endif>>\n<<endif>>

"Well that makes sense just basd on the recursive properties of DFS" Caden thinks to himself. He continued to skip pages until he see another interesting bit.\n\n"//The White-path theorem//\nIn a depth-ﬁrst forest of a (directed or undirected) graph G = (V, E), vertex v is a descendant of vertex u if and only if at the time u.d that the search discovers u, there is a path from u to v consisting entirely of white vertices"\n<<set $understanding = $understanding + 3>>\n[[Next-->|B4]]\n<<if $understanding gte 18>>\n<<if ($lunch) and (not $home)>>\n[[Finish Lunch]]\n<<else>>\n[[Finish Reading]]\n<<endif>>\n<<endif>>

FUCK YOU RECURSIVELY\n<<display "FUCK YOU">>

Alexander McCaleb\nDANM 132\n7/31/11

<<if not ($lunch)>>\n"Fair enough. Actually, I think I'm gonna head home. Maybe there I can either sleep or find some focus to prepare for the test. We'll see" stated Caden.\n<<endif>>\nCaden began walking down to the parking lot when he noticed a group of 7th grade girls walking by.\n\n"Jesus Christ, these girls are like 5! Why are they thinking about college so soon... that's insane!" Caden thought to himself.\n\n"By the time they even get to college, chances are that tuition will be in the fucktillions anyway. Hope they got rich parents..."\n[[Next-->|On the road]]