0.1.3 palindrome

This commit is contained in:
Rob Tillaart 2023-11-14 17:12:20 +01:00
parent d57d47b40c
commit 74ced9f875
7 changed files with 51 additions and 13 deletions

View File

@ -6,12 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/). and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.3] - 2023-11-14
- update readme.md
## [0.1.2] - 2022-11-19 ## [0.1.2] - 2022-11-19
- add RP2040 in build-CI - add RP2040 in build-CI
- add changelog.md - add changelog.md
- update keywords.txt - update keywords.txt
## [0.1.1] - 2021-12-03 ## [0.1.1] - 2021-12-03
- add palindromeCount() - add palindromeCount()
- add palindromePercentage() - add palindromePercentage()

View File

@ -5,10 +5,12 @@ palindrome KEYWORD1
# Methods and Functions (KEYWORD2) # Methods and Functions (KEYWORD2)
isPalindrome KEYWORD2
findPalindrome KEYWORD2 findPalindrome KEYWORD2
findEvenPalindrome KEYWORD2 findEvenPalindrome KEYWORD2
findOddPalindrome KEYWORD2 findOddPalindrome KEYWORD2
isPalindrome KEYWORD2
palindromeCount KEYWORD2 palindromeCount KEYWORD2
palindromePercentage KEYWORD2 palindromePercentage KEYWORD2

View File

@ -15,9 +15,9 @@
"type": "git", "type": "git",
"url": "https://github.com/RobTillaart/palindrome.git" "url": "https://github.com/RobTillaart/palindrome.git"
}, },
"version": "0.1.2", "version": "0.1.3",
"license": "MIT", "license": "MIT",
"frameworks": "arduino", "frameworks": "*",
"platforms": "*", "platforms": "*",
"headers": "palindrome.h" "headers": "palindrome.h"
} }

View File

@ -1,5 +1,5 @@
name=palindrome name=palindrome
version=0.1.2 version=0.1.3
author=Rob Tillaart <rob.tillaart@gmail.com> author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com> maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Palindrome library sentence=Palindrome library

View File

@ -1,7 +1,7 @@
// //
// FILE: palindrome.cpp // FILE: palindrome.cpp
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.1.2 // VERSION: 0.1.3
// PURPOSE: Arduino library to do palindrome experiments. // PURPOSE: Arduino library to do palindrome experiments.
// URL: https://github.com/RobTillaart/palindrome // URL: https://github.com/RobTillaart/palindrome

View File

@ -2,7 +2,7 @@
// //
// FILE: palindrome.h // FILE: palindrome.h
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.1.2 // VERSION: 0.1.3
// PURPOSE: Arduino library to do palindrome experiments. // PURPOSE: Arduino library to do palindrome experiments.
// URL: https://github.com/RobTillaart/palindrome // URL: https://github.com/RobTillaart/palindrome
// //
@ -10,7 +10,7 @@
#include "Arduino.h" #include "Arduino.h"
#define PALINDROME_LIB_VERSION (F("0.1.2")) #define PALINDROME_LIB_VERSION (F("0.1.3"))
class palindrome class palindrome

View File

@ -2,8 +2,11 @@
[![Arduino CI](https://github.com/RobTillaart/palindrome/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci) [![Arduino CI](https://github.com/RobTillaart/palindrome/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![Arduino-lint](https://github.com/RobTillaart/palindrome/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/palindrome/actions/workflows/arduino-lint.yml) [![Arduino-lint](https://github.com/RobTillaart/palindrome/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/palindrome/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/palindrome/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/palindrome/actions/workflows/jsoncheck.yml) [![JSON check](https://github.com/RobTillaart/palindrome/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/palindrome/actions/workflows/jsoncheck.yml)
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/palindrome.svg)](https://github.com/RobTillaart/palindrome/issues)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/palindrome/blob/master/LICENSE) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/palindrome/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/palindrome.svg?maxAge=3600)](https://github.com/RobTillaart/palindrome/releases) [![GitHub release](https://img.shields.io/github/release/RobTillaart/palindrome.svg?maxAge=3600)](https://github.com/RobTillaart/palindrome/releases)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/palindrome.svg)](https://registry.platformio.org/libraries/robtillaart/palindrome)
# Palindrome # Palindrome
@ -16,17 +19,30 @@ Library for palindrome search
The palindrome library can test if a string is a palindrome and is able to find The palindrome library can test if a string is a palindrome and is able to find
the longest palindrome within a character string. the longest palindrome within a character string.
This library is written mainly for some educational purpose, however other
applications are possible. Please share your ideas.
#### tests
The library is tested with an Arduino UNO, random string of 1600 characters. The library is tested with an Arduino UNO, random string of 1600 characters.
(TODO performance compare)
## Interface ## Interface
```cpp
#include "palindrome.h"
```
- **palindrome()** constructor. - **palindrome()** constructor.
- **int findPalindrome(const char \* str, int & position, int & length)** find the longest palindrome in a string. (first occurrence). - **int findPalindrome(const char \* str, int & position, int & length)** find the longest palindrome in a string. (first occurrence).
- **int findEvenPalindrome(const char \* str, int & position, int & length)** find the longest palindrome in a string with even length. (first occurrence). - **int findEvenPalindrome(const char \* str, int & position, int & length)** find the longest palindrome in a string with even length. (first occurrence).
- **int findOddPalindrome(const char \* str, int & position, int & length)** find the longest palindrome in a string with odd length. (first occurrence). - **int findOddPalindrome(const char \* str, int & position, int & length)** find the longest palindrome in a string with odd length. (first occurrence).
- **bool isPalindrome(const char \* str)** checks if a string is a palindrome. - **bool isPalindrome(const char \* str)** checks if a string is a palindrome.
- **int palindromeCount(const char \* str)** returns the count of matching pairs in a string. This is at most the ```length / 2 + 1```. - **int palindromeCount(const char \* str)** returns the count of matching pairs in a string.
This is at most the ```length / 2 + 1```.
- **float palindromePercentage(const char \* str)** returns the count as percentage 0.0 .. 100.0 % - **float palindromePercentage(const char \* str)** returns the count as percentage 0.0 .. 100.0 %
@ -42,8 +58,14 @@ The examples show the basic working of the functions.
## Future ## Future
#### Must
- update documentation - update documentation
- should this be a class?
#### Should
#### Could
- function names? - function names?
- palindromeCount -- symmetryCount? - palindromeCount -- symmetryCount?
- palindromePercentage -- symmetryPercentage? - palindromePercentage -- symmetryPercentage?
@ -54,3 +76,14 @@ The examples show the basic working of the functions.
- investigate case (in)sensitive flag? - investigate case (in)sensitive flag?
- investigate ignore spaces flag? - investigate ignore spaces flag?
#### Wont
## Support
If you appreciate my libraries, you can support the development and maintenance.
Improve the quality of the libraries by providing issues and Pull Requests, or
donate through PayPal or GitHub sponsors.
Thank you,