Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/newaeonweb/palindrome
https://github.com/newaeonweb/palindrome
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/newaeonweb/palindrome
- Owner: newaeonweb
- Created: 2016-02-20T16:05:51.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-20T20:14:06.000Z (almost 9 years ago)
- Last Synced: 2023-04-05T06:06:18.288Z (over 1 year ago)
- Language: JavaScript
- Size: 52.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Instructions:
---1- The test assumes that you have installed on your machine the Node.js.
If you still do not have Node.js follow the following statement:
Go to: https://nodejs.org/en/download/, download and install the compatible version with your system.
Clone the project;
git clone https://github.com/newaeonweb/palindrome.git
Go to project folder
2- Install Dependencies:
Open your shell and type:
npm install
3- To run the program you should open your shell on `Palindrome folder ` and type:
node
Now let's load the file in memory:
.load Palindrome.js
4- The search is made through the text you want to compare if is Palindrome or not using the Palindrome function, as shown below.
Palindrome("aba")
> the function's Return `true`
5- For a better implementation we can add the messages on our Terminal/Shell:
* is a palindrome
* is not a palindromeExample:
isPalindrome(str);
if (isPalindrome() === true) {
return "is a palindrome"
} else {
return "is not a palindrome"
}The following image, illustrate the result on Terminal window:
![Palindrome Terminal](http://www.newaeonweb.com.br/assets/images/Palindrome.png)
# Examples using pure javascript implementation.
> Because sometimes we need to reinventing the wheel.* CheckPalindromeIteration(str);
* CheckPalindromeRecursion(str);To use this functions, you must follow the steps: 1, 2, 3.
Instead of typing `isPalindrome("aba")` on your Terminal, replace for:CheckPalindromeIteration("aba")
CheckPalindromeRecursion("aba")
Happy testing!