Code Puzzle Hunt
Below are the “code based puzzles” which were part of the puzzle hunt which i organised.
The Intro Puzzle
1: Str1 is “Delivery Innovationâ€
2: Print “Enter your email id e.g. abc@amdocs.comâ€
3: Put input into Str2
4: p1 = substr(Str1,0,2)
5: p2 = take first two characters after the last . in Str2
6: Puzzle_Hunt_Name = p1+â€.â€+p2+lower_case(p1)
7: If (you managed to get Puzzle_Hunt_Name ) then
8: Reply to mail with Puzzle_Hunt_Name
8: Print “You are ready for the puzzle huntâ€
10: endif
Day 1
FIND THE OUTPUT:
Assume all required declarations/surrounding blocks are present.
The sections of code are assumed to pass compilation.
Each chunk of code is coded in a different language mentioned within “” before the code e.g.
Assume that there is no newline at the end of each chunk’s output i.e. you get one word combining the three outputs.
——————————
“java”
String temp = “pacman” ;
System.out.println(temp.charAt(2)+””+temp.charAt(1)+””+temp.charAt(0));
“tcsh”
echo “in taken output” | tr -s ” ” | cut -d”n” -f2 | cut -d”k” -f1 | cut -d” ” -f2
“C”
scanf (“%s”, dest); /*Your input is the word innovation*/
m=strlen(dest);
printf (“%c%c”,dest[m -10],dest[1]);
————————————
Day 2
Fill in the crossword with 8 words (4 across and 4 down).
The clues for each of them are in the form of regular expressions i.e. find a word which would match the regular expression.
Check out http://perldoc.perl.org/perlretut.html for a very detailed tutorial on regex.
All the words make sense – maybe proper nouns too.
Day 3
FIND THE OUTPUT:
Assume all required declarations/surrounding blocks are present.
The section of code is assumed to pass compilation.
——————————
#include
int main()
{
char p[] = “MIRESKONEK”;
char test[] = “JOKER”;
int a = 5;
if(test[4]=’r’){
printf(“%c%c”,p[a++],p[a+3]);
}
else printf(“%c”,p[a-3]);
printf(“%c”,p[2]);
return 0;
}
Final Puzzle:
You have answers from the 3 day’s puzzles.
Each line below has a number or a clue which leads to a number.
Add all these numbers i.e. get the total.
Now, connect this final number to the answers of the three puzzles until now to get the final answer.
1. CDXCVI
2. 8
3. 986
4. eerthderdnuhdnaytnevesxis
5.
Put the FINAL ANSWER in the comments.