943,789 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 1775
  • C# RSS
May 4th, 2008
0

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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
quecoder is offline Offline
12 posts
since Mar 2008
May 5th, 2008
0

Re: how to make this program ( very simple ) ? [<< newbie ]]

post your code...
Reputation Points: 1182
Solved Threads: 392
Posting Sensei
Jx_Man is offline Offline
3,138 posts
since Nov 2007
May 6th, 2008
0

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.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
corwing is offline Offline
10 posts
since Apr 2008
May 6th, 2008
0

Re: how to make this program ( very simple ) ? [<< newbie ]]

thank you corwing , it helped a lot ...
I need to read some and post code as you said ..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
quecoder is offline Offline
12 posts
since Mar 2008

This thread is more than three months old

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.
Message:
Previous Thread in C# Forum Timeline: i need help!!!
Next Thread in C# Forum Timeline: Set NET version in VS2008?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC