Skip to content

RaphaelSilv/palindrome-hunter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Palindrome Hunter

Find any atomic or permuted palindrome in any given file.

Atomic palindrome example: "civic"
!Atomic palindrome example: "A nut for a jar of tuna"

./artifacts/woodtype.jpg

“Remember, things take time”


Piet Hein

Motivation

Improve my c++ skills implementing something meaningful.

Is there anything useful here ?

Well, I tried the most apply programming good practices, clean code principles and problem solving attitude(i.e. rack your brains). So, yes.

References

Programming Principles And Practice Using C++ - Second Edition
By the great, Bjarne Stroustrup C++ creator.

Runnin’ it

Specify the file name properly placed at artifacts folder when instantiate a palindrome object like so:

#include "src/palindrome.h"

int main(int argc, char const *argv[]) {

  Palindrome palindrome = { "the-tragedy-of-hamlet-by-w-shakspeare.txt" };
  palindrome.readWordsFromFile();
}

Run it Forest, run..

g++ src/palindrome.cpp main.cpp -o <output file name>

Expected output:

did is The Permuted Palindrome #435
too is The Permuted Palindrome #436
bee is The Permuted Palindrome #437
offendendo is The Permuted Palindrome #438
bee is The Permuted Palindrome #439
hee is The Permuted Palindrome #440

About

Find atomic palindromes in any given file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published