2021-12-03 09:28:47 -05:00
|
|
|
#pragma once
|
|
|
|
//
|
|
|
|
// FILE: palindrome.h
|
|
|
|
// AUTHOR: Rob Tillaart
|
2022-11-19 07:03:21 -05:00
|
|
|
// VERSION: 0.1.2
|
2021-12-03 09:28:47 -05:00
|
|
|
// PURPOSE: Arduino library to do palindrome experiments.
|
|
|
|
// URL: https://github.com/RobTillaart/palindrome
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#include "Arduino.h"
|
|
|
|
|
2022-11-19 07:03:21 -05:00
|
|
|
#define PALINDROME_LIB_VERSION (F("0.1.2"))
|
2021-12-03 09:28:47 -05:00
|
|
|
|
|
|
|
|
|
|
|
class palindrome
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
palindrome();
|
|
|
|
|
|
|
|
bool isPalindrome(const char * str);
|
|
|
|
|
|
|
|
int findPalindrome(const char * str, int & position, int & length);
|
|
|
|
int findEvenPalindrome(const char * str, int & position, int & length);
|
|
|
|
int findOddPalindrome(const char * str, int & position, int & length);
|
|
|
|
|
|
|
|
int palindromeCount(const char * str);
|
|
|
|
float palindromePercentage(const char * str);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// -- END OF FILE --
|
|
|
|
|
|
|
|
|