Using palindrome with private servers [QUEST]
Using palindrome with private servers
Some of you do nt know what a palindrome is do you? well lucky i brought you some information from wikipedia
A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction (the adjustment of punctuation and spaces between words is generally permitted). Composing literature in palindromes is an example of constrained writing. The word "palindrome" was coined from Greek roots palin (πάλιν; "back") and dromos (δρóμος; "way, direction") by English writer Ben Jonson in the 1600s. The actual Greek phrase to describe the phenomenon is karkinikę epigrafę (καρκινική επιγραφή; crab inscription), or simply karkinięoi (καρκινιήοι; crabs), alluding to the backward movement of crabs, like an inscription which can be read backwards.
So basically, its a word that when you say it back words its the same as you say it frontwards
So lets see a palindrome code.
Code:
public class Palindrome {
public static void main(String[] args) {
String str1 = "eye", str2 = "bye";
System.out.println("Palindrome detection");
System.out.println(str1 + " "
+ isPalindrome(str1));
System.out.println(str2 + " "
+ isPalindrome(str2));
}
static boolean isPalindrome(String s) {
int left = 0;
int right = s.length() - 1;
while (left < right) {
if (s.charAt(left) != s.charAt(right))
return false;
left++;
right--;
}
return true;
}
}
satified?
well it looks hard dont it. il just explain it to you
saving that in your server folder would work but, you cant make it work
so lets see a way to make it work
(P.S the reson i am making this is so that you can use it for quests like runescape did)
well to start these are mostly stuff to do with strings
so
if i got
Code:
public void questpart1ofpalindrome(String[] args) {
String qus1 = "Tod saw", qus2 = "I Was Tod";
c.sendMessage("Palindrome detection");
c.sendMessage(qus + " "
+ isPalindrome(qus));
c.sendMessage(qus + " "
+ isPalindrome(qus));
}
static boolean isPalindrome(String s) {
int left = 0;
int right = s.length() - 1;
while (left < right) {
if (s.charAt(left) != s.charAt(right))
return false;
left++;
right--;
}
return true;
}
}
so in game it will sendmessage Dot Saw I Was Tod
Backwards
doT saW I waS toD
how cool is that?
yes this is java, i recommend to use on a stable base like rs2dv, but i will update this when i get around to fixing my rs2dv source.
Part 2
Yes already some people get confused on what you can use this for, well guests are a good start, runescape use it for quests so why dont you use it.
its just more of a challenge for you people to actually learn somthing.
So in the code in The first part of my tutorial, there was this
Code:
public void questpart1ofpalindrome(String[] args) {
String qus1 = "Tod saw", qus2 = "I Was Tod";
c.sendMessage("Palindrome detection");
c.sendMessage(qus + " "
+ isPalindrome(qus));
c.sendMessage(qus + " "
+ isPalindrome(qus));
}
static boolean isPalindrome(String s) {
int left = 0;
int right = s.length() - 1;
while (left < right) {
if (s.charAt(left) != s.charAt(right))
return false;
left++;
right--;
}
return true;
}
}
the void, so if i will now learn you how to add this into your server.
Step 1
Add the code above under
Code:
public class client extends Player implements Runnable {
Step 2
How to make it work, using it ect.
now search for
"object click"
then in that case add this
Code:
if(objectID == ####) { // palindrome
questpart1ofpalindrome();
}
There, you have done it!
easy? guess so hardest part is making it handler.