12
$\begingroup$

An entry in Fortnightly Topic Challenge #35: Restricted Title 1.
Computational Linguists


In order to help me boost my paltry grades, the professor of my computer class has given me an extra credit assignment. He say's that it's due on the 10th, but I don't even know what he wants me to do! I've compiled the following code in FlashDevelop and it runs and shows no errors, but it doesn't seem to do anything worthwhile, either.

He told me that the first part of the assignment is figuring out how to get the code to output a hint to the next part of the assignment.

At least it isn't a book report, am I right? He knows how much I hate them!

Hint:

I'm not sure if this is any better or not, but I changed the way that answer.meta is put together. This is more 'elegant,' right? I also got rid of the extra "." in the parsing loop. I still can't figure out what the 2nd half of my assignment is, though.


package {
    import flash.display.Sprite;
    import flash.events.Event;

    public class ComputationalLinguists extends Sprite{
        private var answer:Answer = new Answer();

        public function ComputationalLinguists():void{
            one();
        }

        private function one():void {
            var jester:Array = ["Spinning Plates","Pointy Hat with Bells on","Curly-Toed Shoes","Juggling Balls","Dubloons","Face Pie"];
            jester.splice(4, 1);
            if (answer.numberOfWords == 8) {
                two();
            }           
        }

        private function two():void {
            var NPH:Sprite = new Sprite();
            stage.addChild(NPH);
            while (NPH.x - NPH.width < stage.stageWidth) { 
                NPH.x+=50;
            }
            if (answer.numberOfWords == 3) {
                three();
            }
        }

        private function three():void {
            var hand:Array = ["Bushtit",, "Dickcissel", "Booby",, "Titmouse", "Hoary Puffleg"];
            var bush:Array = [];
            for (var i:int = 0; i < hand.length; i++) {
                hand[i] == null?bush.push(0):bush.push(2);
            }
            if (answer.numberOfWords == 11) {
                four();
            }
        }

        private function four():void {
            var FrequencyActivatedRumbleTremors:Boolean;
            var smelt:Boolean=true;
            FrequencyActivatedRumbleTremors = smelt;
            var culprit:String;
            hewho(FrequencyActivatedRumbleTremors);
            function hewho(it:Boolean):String{
                if (smelt==it) {
                    var dealt:String = "whoever";
                    return dealt;
                }
                return "the dog";
            }
            if (answer.numberOfWords == 5) {//EDIT: Typo was three, now 5
                five();
            }
        }

        private function five():void {
            var u:int = 0; var m:int = 0;
            u < m ? u = u + m:m = u;
            if (answer.numberOfWords == 7) {
                six();
            }
        }

        private function six():void {
            var day:Array = new Array(true, true, true, true, true, true, true);
            var result:String;
            for each (var apple:Boolean in day){
                result =apple?enjoy():pcp();
            }
            function enjoy():String {
                return "Crunch";
            }
            function pcp():String {
                return "Bill";
            }
            if (answer.numberOfWords == 8) {
                seven();
            }
        }

        private function seven():void {
            var you:int = String(Math.pow(10, 6)).indexOf("1");
            if (answer.numberOfWords == 5) {
                eight();
            }
        }

        private function eight():void {
            var madness:Boolean = false;
            var giveUp:int = 0;
            do {
                !madness ? madness = !madness:madness;
            } while (madness == true && giveUp++ < 1000);
            if (answer.numberOfWords == 14) {
                nine();
            }
        }

        private function nine():void {
            var life:String = "bitch";
            var you:String = "PuzzlingSEMember";
            while (life=="bitch") {
                life ="A "+life;
            }
            die(you);
            function die(a:int):void {
                return;//I found and stopped this error!
                throw new Error("You're dead");
            }
            if (answer.numberOfWords == 6) {
                ten();
            }
        }

        private function ten():void {
            var country:String = "US";
            if (country != "US") {
                return;
            }
            var white:Boolean;
            for (var mo:int = 0; mo < 12; mo++) {
                var Mon1:int=31;
                for (var d:int = 1; d < 31; d++) {
                    var dateObj:Date = new Date(2018, mo, d);
                    var month:int = dateObj.getMonth();
                    var weekday:int = dateObj.getDay();
                    var date:int = dateObj.getDate();
                    if (weekday == 1 && d < 8) {
                        Mon1 = d;
                    }
                    white = !(month > 8 || month == 8 &&  d > Mon1);
                }
            }
            if (answer.numberOfWords == 6) {
                meta();
            }
        }

        private function meta():void {
            var answers:Array = [answer.a1, answer.a2, answer.a3, answer.a4, answer.a5, answer.a6, answer.a7, answer.a8, answer.a9, answer.a10];
            var debris:Array = new Array(".", "?", "!", "-", "*", "/", ",", "'");
            for (var a:int = 0; a < answers.length; a++) {
                for (var i:int = 0; i < debris.length; i++){
                    answers[a] = answers[a].split(debris[i]).join("");
                }
            }
            var index:Array = [1,4,9,7,4,0,8,1,8,0];
            for(var b:int = 0; b < answers.length; b++) {   //        now using array 
                answer.meta += answers[b].substr(index[b], 1); //        for elegance
            }
            /*answer.meta = answer.a1.substr(1, 1) + answer.a2.substr(4, 1) + answer.a3.substr(9, 1) + answer.a4.substr(7, 1) + answer.a5.substr(4, 1) + answer.a6.substr(0, 1) + answer.a7.substr(8, 1) + answer.a8.substr(1, 1) + answer.a9.substr(8, 1) + answer.a10.substr(0, 1);*/
            trace(answer.meta);
        }
    }//end  Class
}//end Package
$\endgroup$
  • $\begingroup$ What kind of type is Answer? Can't seem to find it anywhere $\endgroup$ – Lily Bergonzat Jun 2 '18 at 4:12
  • $\begingroup$ The enigmatic-puzzle tag, shown below the question, means "Puzzles where the genre or solving strategy of the puzzle is not explicitly stated; puzzles where the puzzler must deduce what type of puzzle it is." $\endgroup$ – Chowzen Jun 2 '18 at 4:21
  • $\begingroup$ @Chowzen is #9 rot13( yvsr'f n ovgpu naq gura lbh qvr )? If so, I think the common usage of that phrase is 7 words, not 6. Maybe you're going for an uncommon variation of the phrase, like leaving out the rot13( naq )? $\endgroup$ – CaptainPlanet Jun 2 '18 at 4:30
  • $\begingroup$ Yes. I've heard it both ways; the answer.numberOfWords = is there to clear up any ambiguity. $\endgroup$ – Chowzen Jun 2 '18 at 4:43
  • $\begingroup$ Should that be answers[b].substr(index[b], 1) in the new answer.meta loop? $\endgroup$ – CaptainPlanet Jun 4 '18 at 21:56
7
$\begingroup$

Here's what I've got so far:

one()

a fool and his money are soon parted

two()

exit stage left

three()

a bird in the hand is worth two in the bush

four()

whoever smelt it dealt it

five()

if you cant beat em join em

six()

an apple a day keeps the doctor away

seven()

youre one in a million

eight()

insanity is doing the same thing over and over again and expecting different results

nine()

lifes a bitch then you die

ten()

dont wear white after labor day

The debris section

just means to remove punctuation from all the above (which I've already done)

Finally

Taking the letters specified by the substring() sections yields: ____oaenbd (where _ indicates a space)

I assume this needs to be unscrambled, but I'm not seeing it yet.

$\endgroup$
  • $\begingroup$ Check #4 now, I had a typo (changed 3 to 5). #2 and the other answers are good. $\endgroup$ – Chowzen Jun 2 '18 at 5:13
  • $\begingroup$ @Chowzen Got it, that makes more sense. I think I have all the individual answers now then, but not seeing the final quite yet... $\endgroup$ – CaptainPlanet Jun 2 '18 at 5:22
  • $\begingroup$ For the clue 5, Vs h pna'g orng z, wbva z $\endgroup$ – Jay Jun 2 '18 at 5:31
  • $\begingroup$ @Jay yea, I got to a similar answer. Although I'm unclear if it should be your literal interpretation - rot13(vs h pnag orng z) - or the interpretation using actual English words - rot(vs lbh pnag orng gurz) - considering that the other answers were all proper English. $\endgroup$ – CaptainPlanet Jun 5 '18 at 19:17
  • $\begingroup$ What you have can be unscrambled to rot 13(onq bar). But shouldn't the debris() make you (erzbir fcnprf) as well because it says join("") $\endgroup$ – nikki Aug 15 '18 at 6:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.