How to count number of palindromes in the sentence
Closed
gealon2024
Posts
7
Registration date
Thursday October 3, 2013
Status
Member
Last seen
April 30, 2014
-
Oct 4, 2013 at 02:29 PM
Blocked Profile - Oct 7, 2013 at 03:06 PM
Blocked Profile - Oct 7, 2013 at 03:06 PM
Related:
- Count palindrome words in a string
- Count if cell contains number - Excel Forum
- How to count names in excel - Guide
- Count sentences âś“ - Programming Forum
- Vba select case string contains - Guide
- Excel count occurrences of string in column - Guide
6 responses
Well, lets break it down.
0. load all variables-IE (PALCOUNT=0; sentance=""; dim wordarray()
1.Trap whole sentence in a variable
2.Count the number of spaces in the sentence
(IE 10-one_two_three_four_five_six_seven_eight_nine_ten_eleven)
3. Make an array with 10+1 slots-populate each element in array as word - redim your array with the count [wordarray(11)].
4. Loop through array and get the word, making another variable for the current word being scoured.
5. Make a logical check with the most right character (last character), with the first.
6. If it passes that test, then check the rest of the characters to see if match working from outter chars into inner.
7. If it passes increment variable of PALCOUNT++;
I am certain that you have this wireframe built but are looking for the actual code. I like to guide and advise, attempting to encourage to do your own research for particulars. I am certain Buno can come up with the C code for this logic.
0. load all variables-IE (PALCOUNT=0; sentance=""; dim wordarray()
1.Trap whole sentence in a variable
2.Count the number of spaces in the sentence
(IE 10-one_two_three_four_five_six_seven_eight_nine_ten_eleven)
3. Make an array with 10+1 slots-populate each element in array as word - redim your array with the count [wordarray(11)].
4. Loop through array and get the word, making another variable for the current word being scoured.
5. Make a logical check with the most right character (last character), with the first.
6. If it passes that test, then check the rest of the characters to see if match working from outter chars into inner.
7. If it passes increment variable of PALCOUNT++;
I am certain that you have this wireframe built but are looking for the actual code. I like to guide and advise, attempting to encourage to do your own research for particulars. I am certain Buno can come up with the C code for this logic.