Author Topic: Word Encoding/Decoding  (Read 10949 times)

0 Members and 1 Guest are viewing this topic.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Word Encoding/Decoding
« Reply #15 on: January 07, 2011, 06:02:06 pm »
What do you mean?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Word Encoding/Decoding
« Reply #16 on: January 07, 2011, 06:06:34 pm »
For my cypher program, QFIBCODE, I need something that can take letters and turn them into numbers (and back again) for the user, so they don't have to remember that A=1, B=2, etc. for themselves, the calculator does the translating for them.

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Word Encoding/Decoding
« Reply #17 on: January 07, 2011, 08:24:10 pm »
For my cypher program, QFIBCODE, I need something that can take letters and turn them into numbers (and back again) for the user, so they don't have to remember that A=1, B=2, etc. for themselves, the calculator does the translating for them.
Well, let's see, you could do that fairly easy with inString, since it returns the position. So, assuming Str2 was whatever character you wanted to find the number for:
Code: [Select]
inString("ABCDEFGHIJKLMNOPQRSTUVWXYZ",Str2)
Should give you the location, or 0 if Str2 wasn't A-Z

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Word Encoding/Decoding
« Reply #18 on: January 07, 2011, 08:58:52 pm »
Ya, that seems like a pretty easy task actually. To go from letter to number you something like Graphmastur said:

Code: [Select]
{4,4→dim([A] \\Using your matrix idea as a basis. I don't know how you have things set up though.
1→B
1→C
For(A,1,length("ABCDFGHIJKLMNOPQ
inString("ABCDEFGHIJKLMNOPQRSTUVWXYZ",sub(Str1,A,1→[A](B,C
B+1-4(B=4→B
C+(B=1→C
End

And to go from number to letter:

Code: [Select]
"_ \\The underscore symbolizes a space.
For(A,1,4
For(B,1,4
Ans+sub("ABCDEFGHIJKLMNOPQRSTUVWXYZ",[A](A,B),1
End
End
sub(Ans,2,length(Ans)-1→Str1

Those both should work, but I just made them on the spot and didn't test them. You might have to flip some things around but the principle remains the same.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Word Encoding/Decoding
« Reply #19 on: January 11, 2011, 01:51:38 pm »
@Holmes
Did this help at all?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline holmes221b

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 282
  • Rating: +13/-1
  • RESISTANCE IS FUTILE.
    • View Profile
    • My Livejournal
Re: Word Encoding/Decoding
« Reply #20 on: January 11, 2011, 02:06:35 pm »
Haven't had a chance to test it yet.

Spoiler For "Projects":
Spoiler For "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX