how to make this program ( very simple ) ? [<< newbie ]]
Expand Post »
Hello ,
Please I want some help in making this small program :
the program looks for 3 or more repeated similar letters and replaces them with two characters , the first is the letter itself ( value ) , and the second character is the number of times it repeated ( count ).
Example :
AAACCMMZZZZ
Converted to :
A3\CC\MM\Z4
( less than three repeats , will be ignored, because when converted , it will contain 2 characters for the count and value , so , no difference in size for the two letter repeats )
it's a means for compressing text files ( r.l.e ) I want to know how to make a windows application that asks the user to browse for the file , and then convert it using the technique i mentioned .
OR asks him for a compressed file and then restores it back to the original version...
ANY help is appreciated ...
Last edited by quecoder; May 4th, 2008 at 7:58 pm.
Re: how to make this program ( very simple ) ? [<< newbie ]]
Quecoder may just need direction and not actual code help yet. Sometimes we just need guidance, not the exact answer.
Ya know like
Get the user's input put it to a string and then parse the string for the first character and then while you do that do a read ahead, if the next character is the same do a read ahead again, repeat until you reach a different character. At that point into the output string you'll want to put in the character you just checked and the count (if count <3 then put in two of the character), then from the position you left off at +1 you will check that character in the string then repeat the read ahead loop again. It is rather simple really. If you need help getting started with coding I suggest you take classes or do some reading and then when you think you're getting there but are stuck, post code and ask for help.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.