Using the above image, one would can Ninja-encode a phrase by replacing each letter by the corresponding phrase.
For example, my name (Lokesh) came out to be 'ta~mo~me~ku~ari~ri' . Notice, I have placed '~' among the sub-words to make the reverse translation easier. I will follow the same notation while converting any other word to Ninja name.
Now, write a program that converts any name in English to Ninja name. Solve this puzzle and enter the answer below
1 2 3 4 5 6 7 8 9 10 |
|
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Cool problem,but the mapping is not one to one. B and J are both ′ k u ′ ,thus making the inverse function have to choose. I got "THE ANSWER TO THIS PROJLEM IS SIX DIVIDED JY HALF".
Also If I were a Ninja I would be killed before I finished saying my name 'chirikatetekudoari ' :)
Yeah, I once got concerned about this regard of mapping being not one to one but later I thought that people would figure it out and hence left it out.
Nice name by the way :P
I know right :) -Zikashitamodorinkajitoku (zikashi for short XD)
C Plus Plus solution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
Mekarukichirika - _ _-
I threw together a crude website to "ninja-ify" and "de-ninja-ify" phrases: tinyurl.com/ninjaify
As for the code, I used JavaScript:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
Now, the decryption function:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
And, just for fun, an encryption function:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
Lang used: java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
#include<stdio.h>
#include<string.h>
```c++ using namespace std; char store[26][6]={"ka","zu","mi","te","ku","lu","ji","ri","ki","zu","me","ta","rin","to","mo","no","ke","shi","ari","chi","do","ru","mei","na","fu","zi"}; int main() { int test=10; while(test--) { char ch[50]; gets(ch); int length=strlen(ch); for(int i=0;i<=length;i++) { if(ch[i]=='~'||ch[i]=='\0') { int j=i-1; for(;(j-1)!=-1&&(ch[j-1]!='\0');j--); ch[i]='\0'; for(int k=0;k<26;k++) { char *c=ch; c=c+j; if(strcmp(c,store[k])==0 ) {cout<<(char)(97+k);break;}
}
}
}
cout<<endl;
}
return 0;
}
``` btw the code for b and j is same that is 'zu' so my program shows b for a 'zu' .MY name - ri~ ki~ rin~ ka~ to~ ari~ ri~ do
Here is my solution in C#
ArrayList ar = new ArrayList();
Hashtable ht = new Hashtable();
ht.Add("ka","A");
ht.Add("zu", "B");
ht.Add("mi", "C");
ht.Add("te", "D");
ht.Add("ku", "E");
ht.Add("lu", "F");
ht.Add("ji", "G");
ht.Add("ri", "H");
ht.Add("ki", "I");
ht.Add("zu2", "J");
ht.Add("me", "K");
ht.Add("ta", "L");
ht.Add("rin", "M");
ht.Add("to", "N");
ht.Add("mo", "O");
ht.Add("no", "P");
ht.Add("ke", "Q");
ht.Add("shi", "R");
ht.Add("ari", "S");
ht.Add("chi", "T");
ht.Add("do", "U");
ht.Add("ru", "V");
ht.Add("mei", "W");
ht.Add("na", "X");
ht.Add("fu", "Y");
ht.Add("zi", "Z");
string s1 = "chi~ri~ku";
string s2 = "ka~to~ari~mei~ku~shi";
string s3 = "chi~mo";
string s4 = "chi~ri~ki~ari";
string s5 = "no~shi~mo~zu~ta~ku~rin";
string s6 = "ki~ari";
string s7 = "ari~ki~na";
string s8 = "te~ki~ru~ki~te~ku~te";
string s9 = "zu~fu";
string s10 = "ri~ka~ta~lu";
string[] sarr = new string[10];
ArrayList are = new ArrayList();
are.Add(s1);
are.Add(s2);
are.Add(s3);
are.Add(s4);
are.Add(s5);
are.Add(s6);
are.Add(s7);
are.Add(s8);
are.Add(s9);
are.Add(s10);
string sg = String.Empty;
for (int j = 0; j < 10; j++)
{
string[] res = are[j].ToString().Split('~');
for (int y = 0; y < res.Length; y++)
{
sg += ht[res[y]].ToString();
}
ar.Add(sg);
sg = "";
}
for (int h = 0; h < ar.Count; h++)
{
MessageBox.Show(ar[h].ToString());
}
Output is "THE ANSWER TO THIS PROBLEM IS SIX DIVIDED BY HALF" - equals 12.
Problem Loading...
Note Loading...
Set Loading...
Python Solution:
-By ta~mo~me~ku~ari~ri