Jump to content

simple ascii decode program

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
1988

1988

    Newbie

  • Members
  • Pip
  • 4 posts
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.


#2
semprance

semprance

    Programmer

  • Members
  • PipPipPipPip
  • 126 posts
Smells like homework...

#3
ZekeDragon

ZekeDragon

    Writes binary right handed and hex left handed

  • Moderators
  • 2,103 posts
What have you got so far? Have you made an attempt at solving this problem?
Wow I changed my sig!