-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlevels.js
1 lines (1 loc) · 32.2 KB
/
levels.js
1
function getRandom(e){return Math.floor(Math.random()*e)}function shuffle(e){array=e.slice(0);var t=array.length,n,r;while(t>0){r=Math.floor(Math.random()*t);t--;n=array[t];array[t]=array[r];array[r]=n}return array}function pick_but_skip(e,t,n,r){counter=5-t.length;items_index=0;for(var i=0;i<t.length;i++){if(counter==e){counter++}r[t[i]]=n[counter];counter++}return r}function negativeminusonemod(e,t){e=e-1;if(e<0){e=e+t}return e}colours=["red","orange","yellow","green","blue","purple"];allclothes=["hat","shirt","pants","shoes"];levels=[{generator:function(){person=[];chanceOfWear={};var e=["shirt"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]||!(e in chanceOfWear)){person[e]=colours[getRandom(6)]}});person["pants"]="yellow";return person},randgen:function(){person=[];chanceOfWear={};var e=["shirt","pants"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]||!(e in chanceOfWear)){person[e]=colours[getRandom(6)]}});return person},validator:function(e){if(e.pants=="yellow"){return true}else{return false}}},{generator:function(){person=[];person["hat"]=colours[getRandom(6)];person["shoes"]=colours[getRandom(6)];if(getRandom(2)==1){person["shirt"]="green";person["pants"]="green"}else{person["shirt"]="blue";person["pants"]="blue"}return person},randgen:function(){person=[];person["hat"]=colours[getRandom(6)];person["shirt"]=colours[getRandom(6)];person["pants"]=colours[getRandom(6)];person["shoes"]=colours[getRandom(6)];return person},validator:function(e){if(e.shirt=="blue"&&e.pants=="blue"||e.shirt=="green"&&e.pants=="green"){return true}else{return false}}},{generator:function(){person=[];chanceOfWear={hat:100,shirt:100,pants:100,shoes:100};var e=["hat","shirt","pants","shoes"];thecolour=colours[getRandom(6)];first=e[getRandom(4)];second=e[getRandom(4)];while(first==second){second=e[getRandom(4)]}third=e[getRandom(4)];while(first==third||third==second){third=e[getRandom(4)]}person[first]=thecolour;person[second]=thecolour;person[third]=thecolour;e.forEach(function(e){if(!(e in person)&&(getRandom(100)<chanceOfWear[e]||!(e in chanceOfWear))){person[e]=colours[getRandom(6)]}});return person},randgen:function(){person=[];chanceOfWear={hat:100,shirt:100,pants:100,shoes:100};var e=["hat","shirt","pants","shoes"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){person[e]=colours[getRandom(6)]}});return person},validator:function(e){valid=false;colours.every(function(t){occurances=0;Object.keys(e).forEach(function(n){if(e[n]==t){occurances++}});if(occurances>2){valid=true;return false}return true});return valid}},{generator:function(){person=[];chanceOfWear={hat:100,shirt:80,pants:100};var e=["hat","shirt","pants"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){person[e]=colours[getRandom(6)]}});person["shoes"]=person["hat"];return person},randgen:function(){person=[];chanceOfWear={hat:100,shirt:80,pants:100,shoes:100};var e=["hat","shirt","pants","shoes"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){person[e]=colours[getRandom(6)]}});return person},validator:function(e){if(e.shoes==e.hat){return true}else{return false}}},{generator:function(){person=[];chanceOfWear={hat:60,shirt:80,pants:100};var e=["hat","shirt","pants"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){person[e]=colours[getRandom(6)]}});if(!person.hat){person["shoes"]=colours[getRandom(6)]}return person},randgen:function(){person=[];person["pants"]=colours[getRandom(6)];if(getRandom(3)==0){person["shirt"]=colours[getRandom(6)]}else{person["hat"]=colours[getRandom(6)];person["shoes"]=colours[getRandom(6)]}return person},validator:function(e){if(e.hat&&!e.shoes||e.shoes&&!e.hat){return true}else{return false}}},{generator:function(){person=[];var e=colours.slice(0);var t=["hat","shirt","pants","shoes"];t.forEach(function(t){var n=getRandom(e.length);person[t]=e[n];e.splice(n,1)});if(!person.hat){person["shoes"]=colours[getRandom(6)]}return person},randgen:function(){person=[];chanceOfWear={hat:100,shirt:100,pants:100,shoes:100};var e=["hat","shirt","pants","shoes"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){person[e]=colours[getRandom(6)]}});return person},validator:function(e){return e.hat!=e.shirt&&e.hat!=e.pants&&e.hat!=e.shoes&&e.shirt!=e.pants&&e.shirt!=e.shoes&&e.pants!=e.shoes}},{generator:function(){person=[];start=getRandom(colours.length);person.hat=colours[start];start=(start+1)%colours.length;person.shirt=colours[start];start=(start+1)%colours.length;person.pants=colours[start];start=(start+1)%colours.length;person.shoes=colours[start];return person},randgen:function(){person=[];chanceOfWear={hat:100,shirt:100,pants:100,shoes:100};var e=["hat","shirt","pants","shoes"];var t=colours.slice(0);e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){var n=getRandom(t.length);person[e]=t[n];t.splice(n,1)}});return person},validator:function(e){return false;lastIndex=colours.indexOf(e.hat);checkClothes=["shirt","pants","shoes"];checkClothes.forEach(function(t){if(!e[t])return false;thisIndex=colours.indexOf(e[t]);if(!((lastIndex+1)%colours.length==thisIndex)){return false}lastIndex=thisIndex});return true}},{generator:function(){person=[];chanceOfWear={hat:25,shirt:50,pants:100,shoes:0};var e=["hat","shirt","pants","shoes"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]||!(e in chanceOfWear)){person[e]=colours[getRandom(6)]}});if(person.shirt){person.shoes="green"}else{person.shoes="purple"}return person},randgen:function(){person=[];chanceOfWear={hat:25,shirt:50,pants:100,shoes:0};var e=["hat","shirt","pants","shoes"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){person[e]=colours[getRandom(6)]}});if(getRandom(2)==1){person["shoes"]="green"}else{person["shoes"]="purple"}return person},validator:function(e){return e.shirt&&e.shoes=="green"||!e.shirt&&e.shoes=="purple"}},{generator:function(){person=[];chanceOfWear={hat:50,shirt:80,pants:100,shoes:80};var e=["hat","shirt","pants","shoes"];yellow=e[getRandom(4)];red=e[getRandom(4)];while(red==yellow){red=e[getRandom(4)]}person[yellow]="yellow";person[red]="red";e.forEach(function(e){if(!(e in person)&&(getRandom(100)<chanceOfWear[e]||!(e in chanceOfWear))){person[e]=colours[getRandom(6)]}});return person},randgen:function(){person=[];chanceOfWear={hat:60,shirt:85,pants:100,shoes:85};var e=["hat","shirt","pants","shoes"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){person[e]=colours[getRandom(6)]}});return person},validator:function(e){return(e.shirt=="yellow"||e.hat=="yellow"||e.pants=="yellow"||e.shoes=="yellow")&&(e.shirt=="red"||e.hat=="red"||e.pants=="red"||e.shoes=="red")}},{generator:function(){person=[];order=setupinfo.order;start=getRandom(order.length);if(getRandom(2)==0){person.hat=order[start];start=negativeminusonemod(start,order.length);person.shirt=order[start];start=negativeminusonemod(start,order.length);person.pants=order[start];start=negativeminusonemod(start,order.length);person.shoes=order[start]}else{person.hat=order[start];start=(start+1)%order.length;person.shirt=order[start];start=(start+1)%order.length;person.pants=order[start];start=(start+1)%order.length;person.shoes=order[start]}return person},randgen:function(){person=[];chanceOfWear={hat:100,shirt:100,pants:100,shoes:100};var e=["hat","shirt","pants","shoes"];var t=setupinfo["colours"].slice(0);e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){var n=getRandom(t.length);person[e]=t[n];t.splice(n,1)}});return person},validator:function(e){order=setupinfo.order;lastIndex=order.indexOf(e.hat);checkClothes=["shirt","pants","shoes"];var t=true;checkClothes.forEach(function(n){if(!e[n]){t=false}thisIndex=order.indexOf(e[n]);if(!((lastIndex+1)%order.length==thisIndex)){t=false}lastIndex=thisIndex});if(t){return true}lastIndex=order.indexOf(e.hat);t=true;checkClothes.forEach(function(n){if(!e[n])t=false;thisIndex=order.indexOf(e[n]);if(!(negativeminusonemod(lastIndex,order.length)==thisIndex)){t=false}lastIndex=thisIndex});return t},setup:function(){var e=[];e["colours"]=colours.slice(0);e["colours"].splice(getRandom(e["colours"]).length,1);e["colours"].splice(getRandom(e["colours"]).length,1);e["order"]=shuffle(e["colours"]);return e}},{generator:function(){person=[];coloursNoRed=["orange","yellow","green","blue","purple"];coloursNoYellow=["red","orange","green","blue","purple"];if(getRandom(2)==0){person.pants="red";person.hat=colours[getRandom(colours.length)]}else{person.pants=coloursNoRed[getRandom(coloursNoRed.length)]}if(getRandom(2)==0){person.shoes="yellow";person.shirt=colours[getRandom(colours.length)]}else{person.shoes=coloursNoYellow[getRandom(coloursNoYellow.length)]}return person},randgen:function(){person=[];chanceOfWear={hat:50,shirt:50,pants:100,shoes:100};var e=["hat","shirt","pants","shoes"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){person[e]=colours[getRandom(colours.length)]}});return person},validator:function(e){if(e.hat){if(!(e.pants=="red"))return false}else{if(e.pants=="red")return false}if(e.shirt){if(!(e.shoes=="yellow"))return false}else{if(e.shoes=="yellow")return false}return true}},{generator:function(){person=[];item_choice=getRandom(15);if(item_choice==0){person.hat=setupinfo["colours"][2];person.shirt=setupinfo["colours"][3];person.pants=setupinfo["colours"][4];person.shoes=setupinfo["colours"][5]}else if(item_choice<=4){person.hat=setupinfo["colours"][1];item_to_skip=item_choice+1;items_to_assign=["shirt","pants","shoes"];person=pick_but_skip(item_to_skip,items_to_assign,setupinfo["colours"],person)}else if(item_choice<=5){person.hat=setupinfo["colours"][0];person.shirt=setupinfo["colours"][3];person.pants=setupinfo["colours"][4];person.shoes=setupinfo["colours"][5]}else if(item_choice<=8){person.hat=setupinfo["colours"][0];person.shirt=setupinfo["colours"][2];item_to_skip=item_choice-3;items_to_assign=["pants","shoes"];person=pick_but_skip(item_to_skip,items_to_assign,setupinfo["colours"],person)}else if(item_choice<=9){person.hat=setupinfo["colours"][0];person.shirt=setupinfo["colours"][1];person.pants=setupinfo["colours"][4];person.shoes=setupinfo["colours"][5]}else if(item_choice<=11){person.hat=setupinfo["colours"][0];person.shirt=setupinfo["colours"][1];person.pants=setupinfo["colours"][3];item_to_skip=item_choice-6;items_to_assign=["shoes"];person=pick_but_skip(item_to_skip,items_to_assign,setupinfo["colours"],person)}else{person.hat=setupinfo["colours"][0];person.shirt=setupinfo["colours"][1];person.pants=setupinfo["colours"][2];person.shoes=setupinfo["colours"][item_choice-9]}return person},randgen:function(){firstnum=getRandom(6);secondnum=getRandom(6);while(secondnum==firstnum){secondnum=getRandom(6)}fake_colours=setupinfo["colours"].slice(0);swapvar=fake_colours[firstnum];fake_colours[firstnum]=fake_colours[secondnum];fake_colours[secondnum]=swapvar;person=[];item_choice=getRandom(15);if(item_choice==0){person.hat=fake_colours[2];person.shirt=fake_colours[3];person.pants=fake_colours[4];person.shoes=fake_colours[5]}else if(item_choice<=4){person.hat=fake_colours[1];item_to_skip=item_choice+1;items_to_assign=["shirt","pants","shoes"];person=pick_but_skip(item_to_skip,items_to_assign,fake_colours,person)}else if(item_choice<=5){person.hat=fake_colours[0];person.shirt=fake_colours[3];person.pants=fake_colours[4];person.shoes=fake_colours[5]}else if(item_choice<=8){person.hat=fake_colours[0];person.shirt=fake_colours[2];item_to_skip=item_choice-3;items_to_assign=["pants","shoes"];person=pick_but_skip(item_to_skip,items_to_assign,fake_colours,person)}else if(item_choice<=9){person.hat=fake_colours[0];person.shirt=fake_colours[1];person.pants=fake_colours[4];person.shoes=fake_colours[5]}else if(item_choice<=11){person.hat=fake_colours[0];person.shirt=fake_colours[1];person.pants=fake_colours[3];item_to_skip=item_choice-6;items_to_assign=["shoes"];person=pick_but_skip(item_to_skip,items_to_assign,fake_colours,person)}else{person.hat=fake_colours[0];person.shirt=fake_colours[1];person.pants=fake_colours[2];person.shoes=fake_colours[item_choice-9]}return person},validator:function(e){order=setupinfo["colours"];return order.indexOf(e.hat)<order.indexOf(e.shirt)&&order.indexOf(e.shirt)<order.indexOf(e.pants)&&order.indexOf(e.pants)<order.indexOf(e.shoes)},setup:function(){var e=[];e["colours"]=shuffle(colours);return e}},{partners:true,generator:function(){first_person=[];second_person=[];var e=["hat","shirt","pants","shoes"];var t=getRandom(4);var n=colours[getRandom(6)];first_person[e[t]]=n;second_person[e[t]]=n;e.splice(t,1);chanceOfWear={hat:100,shirt:100,pants:100,shoes:100};e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){first_person[e]=colours[getRandom(6)];second_person[e]=colours[getRandom(6)]}});return[first_person,second_person]},randgen:function(){person=[];chanceOfWear={hat:100,shirt:100,pants:100,shoes:100};var e=["hat","shirt","pants","shoes"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){person[e]=colours[getRandom(6)]}});return person},validator:function(e,t){clothes=["hat","shirt","pants","shoes"];legit=false;clothes.forEach(function(n){legit=legit||e[n]==t[n]});return legit}},{partners:true,generator:function(){first_person=[];second_person=[];if(getRandom(2)==1){first_person.hat=colours[getRandom(6)]}else{second_person.hat=colours[getRandom(6)]}if(getRandom(2)==1){first_person.shirt=colours[getRandom(6)]}else{second_person.shirt=colours[getRandom(6)]}if(getRandom(2)==1){first_person.shoes=colours[getRandom(6)]}else{second_person.shoes=colours[getRandom(6)]}first_person.pants=colours[getRandom(6)];second_person.pants=colours[getRandom(6)];return[first_person,second_person]},randgen:function(){person=[];chanceOfWear={hat:50,shirt:50,pants:100,shoes:50};var e=["hat","shirt","pants","shoes"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){person[e]=colours[getRandom(6)]}});return person},validator:function(e,t){clothes=["hat","shirt","shoes"];legit=true;clothes.forEach(function(n){legit=legit&&(e[n]==null&&t[n]!=null||t[n]==null&&e[n]!=null)});return legit}},{partners:true,generator:function(){first_person=[];colours_left=colours.slice(0);chanceOfWear={hat:50,shirt:90,pants:100,shoes:75};var e=["hat","shirt","pants","shoes"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){item_colour=colours[getRandom(6)];first_person[e]=item_colour;index=colours_left.indexOf(item_colour);if(index>-1){colours_left.splice(index,1)}}});second_person=[];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){item_colour=colours_left[getRandom(colours_left.length)];second_person[e]=item_colour}});return[first_person,second_person]},randgen:function(){person=[];chanceOfWear={hat:50,shirt:90,pants:100,shoes:75};var e=["hat","shirt","pants","shoes"];e.forEach(function(e){if(getRandom(100)<chanceOfWear[e]){person[e]=colours[getRandom(6)]}});return person},validator:function(e,t){var n=["hat","shirt","pants","shoes"];var r=colours.slice(0);legit=true;n.forEach(function(t){index=r.indexOf(e[t]);if(index>-1){r.splice(index,1)}});n.forEach(function(e){index=r.indexOf(t[e]);if(index==-1){legit=false}});return legit}}];stories=[["Chapter One: The Odd Job",'<p>"This has to be the oddest job we\'ve been given, %PROT%."</p> <p>Jed was certainly right. As private investigators, we\'d seen some interesting things, but nothing quite as bizarre.</p><p>"Who has ever heard of an invite-only bank? How can such an exclusive organisation allow in people without any suits and ties? Can\'t a bank afford a less shabby building?"</p><p>"I noticed that too", I added. "We\'d never fit in, we\'re too overdressed. We\'d best pay a visit to the department store and select some more suitable costumes. Then if we act natural enough, we might be able to just walk in."</p>'],["Chapter Two: A Return Visit",'<p>"Again?" complained Jed. "Will we be changing our name to \'%PROT% and Jed, Mail Couriers?\'"</p><p>"Whatever pays the bills, Jed."</p><p>"At least we already have costumes this time. Let\'s get this over with."</p><p>"Wait", I said, motioning Jed to halt. "Look at the line. Something has changed. I don\'t think we\'ll fit in with our old costumes anymore." It was time for another visit to the department store.</p>'],["Chapter Three: Interception",'<p>"Remind me why we\'re doing this again, please." complained Jed. "What if our client finds out? What happened to \'whatever pays the bills\'?"</p><p>"What happened to your sense of curiosity? You\'re the one that held the letter up to the light. You\'re the one who tracked down this place. We\'ll get in there, do a quick survey of the building, and get out."</p><p>"Fine. But let\'s not poke our noses too deep."</p><p>"Looks like we\'ll need to figure out the dress code again," I said, observing the people walking inside. "Whoever sells bright colours around this town must be making a killing,"</p>'],["Chapter Four: Tailing",'<p>"There!" whispered Jed. "He entered that building."</p><p>"He was in a hurry", I noted, "he jumped the queue!".</p><p>"If he just stole something, I hardly think he\'d be in the mood for politeness, %PROT%."</p><p>"Okay. What\'s the plan?"</p><p>Jed sighed. "I guess we\'re sneaking into another of these weird buildings."</p></p>'],["Chapter Five: The Test",'<p>"Now this just seems silly" I admitted to Jed. "We\'re literally breaking into a restaurant for this guy."</p><p>"If it\'s such an exclusive restaurant, why isn\'t the dress code a bit fancier? Some people aren\'t even wearing shoes." I puzzled.</p><p>"Hippy commune?" suggested Jed.</p><p>"At this point I\'m open to any theories, Jed."</p>'],["Chapter Six: The Return Return Visit","<p>The client fell far short of 'explaining everything'. He gave us as little information as possible, and refused to answer further questions. We learned that there was an additional intelligent life form inhabiting the planet. They masqueraded as humans, aided by their own humanoid form. There was a recent split into two factions: one group desired infiltration for the furthering of the race's goals; the other was bent on destruction of the human race. Thankfully our client fell into the former category.</p><p>\"How's '%PROT% and Jed, saviours of the world'?\" I suggested. \"It's got a nice ring to it\".</p><p>Jed ignored me. \"And we've arrived back at the bank,\" he announced. \"Whatever is in those packages must be important.\"</p>"],["Chapter Seven: A Blank Book",'<p>"We really should\'ve thought of that," I confessed to Jed. "Why would we ever think we could read the writing of another species?"</p><p>"No, <em>HE</em> should have thought of that, not us, %PROT%." replied Jed, flicking through the \'code book\' consisting of extremely thick pages with no visible writing. "Do you get the feeling someone\'s playing a big joke on us?"</p><p>"If someone is playing a joke, that\'s fine by me, given the sizeable payments we\'ve already received."</p><p>"I wonder how old the book is," said Jed, leaning in to smell. "PHWOAR!" he exclaimed, jerking back, "It\'s really strong!"</p><p>"That\'s it!" I realised. "He said their smell is better than their sight - it makes sense their code book would be communicated in smells! We just need to figure out what each smell means. Then we can look up the code we were given, and see what to wear."</p><p>"... Or we could just watch what people are wearing, again." reasoned Jed.</p><p>"Yeah ok that seems simpler."</p>'],["Chapter Eight: The Fourth Visit",'<p>"I wish they didn\'t keep changing the dress code. It would make things so much easier for us." complained Jed.</p><p>"If they didn\'t change the code you could just keep guessing it by trying different clothes." I suggested.</p><p>"Then why don\'t they pick a better security method? Like a passphrase, or ID?"</p><p>"Passphrases can be overheard. Their eyesight might not be good enough to check IDs. If their pattern recognition is worse than ours, maybe a dress code is strong enough security for them."</p><p>"Good points." said Jed. He scanned the line. "I think I can see today\'s pattern."</p>'],["Chapter Nine: The Last Piece",'<p>We approached the target building in the required costumes: purple hat and yellow shoes.</p><p>"Something\'s not right," Jed whispered. "Nobody else fits the pattern. Either the client smelt the code book index wrong, or the dress code was changed."</p><p>"You\'re right. We should have known it wouldn\'t be that simple. We\'ll just have to crack the code ourselves."</p><p>"Because my trash can doesn\'t already have enough green shoes." grumbled Jed sarcastically.</p>'],["Chapter Ten: The Detonator!",'<p>It wasn\'t hard to spot the \'secret\' base. It was the only building across the road with a line of bright colours queuing to enter.</p><p>"We need to be quick," I urged, "We don\'t know how much time there is left."</p><p>"Stay calm, %PROT%, we need to concentrate." said Jed. "Bob whatever said this would be a difficult code."</p><p>"Put on this cologne," he added. "We should mask our smell to avoid identification."</p>'],["Chapter Eleven: A Lack of Recognition",'<p>On return to the client\'s office building, we were barred entry.</p><p>"It\'s the cologne," I suggested, "Our smell isn\'t recognised anymore."</p><p>"Looks like we\'re cracking another dress code" sighed Jed.</p>']];failures=["<h1>No Entry</h1><p>As Jed and I approached the back of the queue, sporting our brand new costumes, the rest of the line fell silent. As the queue progressed, Jed pulled me aside.</p><p>\"Do you notice the guards are staring at us? I don't think they're going to allow us in.\"</p><p>\"You're right; they seem to be able to tell us apart. There must be a pattern that everyone else is following that we just don't fit. Perhaps we need to revisit the costume store and buy costumes that fit in.\"</p>"];successes=['<h1>No Questions Asked</h1><p>Jed and I joined the back of the queue without any noticeable reaction from the other members of the line. We followed the others through the bank entrance without any sign of challenge from the guards. </p><p>"That was suprisingly easy", I whispered. "No questions or ID checks. We must have been able to fit in."</p><p>We found our way to the 24th office on the second floor, as instructed, nervously opening the door. On the desk there was a brown parcel with no labels or address. Jed looked relieved: "Just as he told us, " he said as he picked up the parcel.</p><p>"Alright, we\'ve got what we need. Let\'s keep it cool on the way out."</p>','<h1>Strange Behaviour</h1><p>Everything was exactly as before, with one exception: the object of interest was a small white envelope.</p><p>On the way out, a man seemed to recognise Jed and approached us. "Ahoyo Bob three three four three. Is this your newest underling?" he inquired. Jed replied "Yes indeed" with an air of confidence. "Alright. Good luck." the man said as he walked off. "Don\'t forget: the dress code tomorrow is zero three eight zero jay."</p><p>...</p><p>"Impressive performance in there Jed. Did you know the guy?" I asked after a safe distance from the bank.</p><p>"I didn\'t recognise him at all. And I know I\'ve never had a nickname of Bob."</p><p>"I noticed his eyes looked glazed and inactive the whole time. Was he blind?"</p><p>"That could explain why he mistook me for someone else. This job only gets stranger."</p>',"<h1>Alarming Sight</h1><p>As soon as we stepped in the building, alarms rang. The guards standing outside rushed in - straight past us. The scene quickly turned chaotic; people rushed out of the building whilst guards ran around frantically, to the tune of what sounded closer to a bombing siren than a fire alarm. Amidst the crowd we spotted the client, clearly carrying something, slip out of the building.</p>",'<h1>Caught!</h1><p>The client had clearly been waiting for us. "Come with me." he said sternly, like he was directing school-boys. Jed and I exchanged worried glances, getting ready to run. He noticed and softened his tone. "There\'s nothing to worry about. But there\'s something we need to discuss."</p><p>He walked us to his small office and offered us chairs.</p><p>"Although my sight may be poor, my smell is much keener than yours." he explained. "However, you have both displayed an advanced level of code cracking proficiency. Your logic circuits are clearly well suited to breaking codes."</p><p>"Err, thanks?" replied Jed, cautiously, unsure of the compliment.</p><p>"I have another task for you - or more accurately, a test."</p>','<h1>A Passing Grade</h1><p>We entered the restaurant just to prove we\'d cracked the code. It looked like any other fancy restaurant, with the exception of a large changing room. Bright colours entered, suits and ties exited. "Dressing up twice seems like a lot of effort" remarked Jed.</p><p>Our client was visibly impressed. "Our best code breakers spent weeks on this place after we couldn\'t get a reservation. You humans must have specialised pattern recognition hardware."</p><p>"You mean you\'re not ... human?" I asked.</p><p>"Come. I will explain everything."</p>',"<h1>Mission Possible</h1><p>We knew the drill by now. We retrieved the package and exited the building without event.</p>",'<h1>The Egg Hunt</h1><p>It was just where the client said it would be. The egg, just like the two others he showed us, but bright red.</p><p>"For such an important item, there\'s next to zero security." observed Jed. "It\'s in this unguarded room for anyone to grab."</p><p>"Ready?"</p><p>"Ready."</p><p>I put the egg in my pocket, and we made for the exit.</p>',"<h1>Watched</h1><p>As we retrieved the next package, I couldn't shake the feeling we were being watched. But we left the building without challenge, once again.</p>",'<h1>The Trap!</h1><p>The moment we entered the building, the guards closed the doors behind us. More guards emerged to surround us, cutting off any option of flight.</p><p>...</p><p>His preference for senses was clearly evident: he had the smallest eyes I\'d ever seen, next to the largest nose I\'d ever seen. His choice of clothing screamed super villain.</p><p>"Good afternoon my dears! I\'m your host, Bob one. What a lovely day to watch the destruction of the human race! From this tower you will view my brilliant plan come to fruition, whilst helplessly tied to your chairs."</p><p>"Just give us the detonator we\'re here to collect, and no-one will get hurt." demanded Jed, unconvincingly.</p><p>Bob one ignored him. "You see, my dear Bobs, I was your \'informer\'. I let you collect the seeds of extermination, despite the extreme costs involved with obtaining them. See, they are indestructable by any technology available in this world. And as they are remotely activated, it doesn\'t matter where they are. It\'s all the more fitting the gas should originate from your headquarters!" He was clearly very proud of himself.</p><p>"I even made you hunt after a non-existant \'detonator\'! However, your code breaking teams have come a long way - I sent you the wrong dress code for this building and it took you less than a day to crack it."</p><p>"Technically if they\'re remotely activated, there must be a detonator." I interjected.</p><p>"WRONG WRONG WRONG!" he yelled as he swooped on me. "It\'s on a countdown, controlled by our secret base across the road."</p><p>"Maybe I shouldn\'t have mentioned that." He paused for a moment. "No matter: your hands are tied, you wouldn\'t be able to find the secret base, and it\'s protected by the strongest dress code ever invented."</p><p>He turned to exited the room, with a twirl of his cape. "Enjoy the show!" he said, closing the door behind. We were alone.</p><p>"Their eye sight really is rubbish." remarked Jed. "These knots are terrible!"</p><p>I joined Jed in slipping out of my bindings.</p>','<h1>Big Buttons</h1><p>It wasn\'t hard to spot the countdown console - inside a room helpfully labelled "CONTROL ROOM" in large red letters. A large screen was counting down: 50 seconds, 49 seconds, 48 seconds ...</p><p>The console consisted of two large red buttons labelled "Cancel" and "Detonate", and a large touch screen. I quickly hit the cancel button.</p><p>A dialog appeared on the touch screen. "Dress Code Required: Please drag the appropriate clothes onto the figure."</p><p>Suddenly the screen and console died. Jed had pulled out the power cord. "We had no time!" explained Jed, anticipating my protest.</p><p>"Look around" I said. "We had to find the technology he was talking about and disable it, so it can\'t be used to activate the detonation later."</p><p>"Like this?" asked Jed, reaching underneath the console and ripping out a long metal rod. "It\'s got another two red buttons, but no writing."</p><p>"Wait, these buttons have a strong smell on them..."</p><p>"I <em>KNEW</em> there must be a detonator!" I said. "Let\'s get out of here before Bob whatsits returns."</p>','<h1>Disarmament</h1><p>The client was extremely relieved when we arrived at his office. "You were gone for a long time, I was getting worried! Why do you smell funny?"</p><p>I explained everything, and presented the metal rod. The client smelt the two buttons individually for a long time, pondering their meaning. He then quickly sniffed each, as if to double check.</p><p>"This button ends your species," he said, "But the other disintegrates the seeds - in effect safely disposing of them."</p><p>He offered it back to me. "You can have the honours. Just press <em>THAT</em> button," he said, pointing with both hands to make sure he was understood.</p><p>I pressed the button nervously. The eggs disappeared in a puff. We had saved the world!</p><h2>THE END.</h2><h3>... for now ... </h3>',"Success! You got into the building.","Success! You got into the building."];hints=[['"Look at all the people that are getting into the bank. They must share something in common that allows each of them entry. We should buy two costumes which also have the characteristic that allows entry." suggested Jed.',"Suddenly it hit me. Everyone had the same taste in pants!"],['"The entrants seem to have a choice of two options which both fit in." observed Jed.',"I came to realise realise that all entrants wore a matching set of shirt and pants, but there seemed to be a choice of colour."],['"There seems to be a lot of matching outfits." observed Jed.',"After hours of scoping the line, I came to notice the entrants were mostly wearing the same colour.."],['"Is there something happening in the hats and shoes?" asked Jed.',"It seemed that there was a particular pair of clothing items which matched for every entrant."],['"People seem to be wearing at least two and at most 3 items of clothing. This must be a result of the dress code." said Jed.',"I noticed there were two types of people entering the building, distinguished by their choice of hat and shoes."],['"Everyone is wearing a variety of colours today." observed Jed.',"The dress code seemed to be something to do with the number of matching items."],['"I don\'t know why, but I keep checking the end of the line for a leprechaun with a pot of gold. The clothes also remind me of the refraction of light" said Jed.',"Just when I thought I would go blind from all the bright colours, I began to discern a pattern in the order of the colours."],['"What\'s up with the shoes?" asked Jed. "Is there a particular reason why some people choose purple, and others choose green?"',"I began to see a relationship between the shirt and shoes that all the entrants were wearing."],['"People here seem to all share some favourite colours," observed Jed.',"I came to see that everyone in the line favoured red and yellow."],['"I think there\'s an order on the colours again," suggested Jed.',"While there was an order on the colours, there seem to be disagreement on how to apply the order."],['"There seems to be a relationship between the bottom half and the top half," observed Jed.',"There were two relationships between the bottom half and the top half of their costumes. One for whether to wear a hat, another for whether to wear a shirt."],['"Is there some sort of order happening?" asked Jed.',"You seemed to notice a pattern in the colours of clothes going from top to bottom."],['"They appear to have similar tastes in clothes." suggested Jed.',"You noticed that partners seemed to pre-arrange a match."],['"They appear to have opposite tastes in clothes." suggested Jed.',"You noticed that clothes one person would wear would not be worn by their partner."],['"Jed looked puzzled. "They don\'t seem to have much in common."',"You noticed that there was some disagreement about the colours to wear."]];buildings=[["building_ground","building_windows"],["building_ground","building_windows"],["hideout_ground","hideout_windows"],["office_ground","office_windows"],["seafood_ground","seafood_windows"],["building_ground","building_windows"],["third_ground","third_windows"],["building_ground","building_windows"],["tower_ground","tower_windows"],["secret_ground","secret_windows"],["office_ground","office_windows"]]