Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

simple ascii decode program

ascii

  • Please log in to reply
2 replies to this topic

#1 1988

1988

    CC Lurker

  • Just Joined
  • Pip
  • 4 posts

Posted 07 April 2010 - 04:20 AM

OK, I'm really new to all this, so I need help.
One of the methods I need to program needs to decode a simple ascii input using preassigned decode String: here's the example of what it needs to do:

Posted Image

In this example I have simple text input with some random characters (cbdacsia...) and decode string (3102). Input text is then cut into 4 char blocks (number of characters in decode string). To decode this input, I need to rearrange place of the characters input according to the decode string ( ie. "c" is located on position "0"; in string decode "0" is located on third position, after which "c" is placed on this new position)

It's really simple, and I think it can be programed in matter of minutes, but I'm newbie and I really need help. I'd really appreciate any help, so I can at least start programing this method.

btw, real text input is much larger and decode string varies. Decode string also shouldn't contain two same numbers/chars.

Anyway, thanks in advance for any help

EDIT: better use long instead String for "decode"

Edited by 1988, 07 April 2010 - 05:04 AM.

  • 0

#2 semprance

semprance

    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 118 posts

Posted 07 April 2010 - 11:21 AM

Smells like homework...
  • 0

#3 ZekeDragon

ZekeDragon

    CC Leader

  • Retired Mod
  • PipPipPipPipPipPipPip
  • 1263 posts

Posted 08 April 2010 - 12:43 AM

What have you got so far? Have you made an attempt at solving this problem?
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download