# Thread: Automate a special letters to numbers conversion process with Fusion

1. ## Automate a special letters to numbers conversion process with Fusion

Imagine that I have 3 words with 5 letters and I manually convert the letters into a 15-digit number by applying 5 different operations.
I need help with 2 operations, so that I can create a one-click generator - for example just type three words with 5 letters(ravenhorsetiger) and get a 15-digit number as result(639864918660971).
These are my rules (1)-(5) on how I manually get the 15-digit number from the words.

My problem is that I don't know how to do step (2) and (3), especially step (2).
start with: R E G I T    E S R O H    N E V A R → step 2: E N R S E    E R V G O    A I H R T → step 3: F M S R F    D S U H P    Z J I Q U

______________________________________________

R A V E N H O R S E T I G E R

(1) reverse order left-to-right:

R A V E N    H O R S E    T I G E R
R E G I T    E S R O H    N E V A R

(2) resort letters with the following rule:

- 1st letter of word 2 is new letter 1
- 1st letter of word 3 is new letter 2
- 1st letter of word 1 is new letter 3
- 2nd letter of word 2 is new letter 4
- 2nd letter of word 3 is new letter 5
- 2nd letter of word 1 is new letter 6
...
- last letter of word 1 is new letter 15

R E G I T    E S R O H    N E V A R
E N R S E    E R V G O    A I H R T

(3) replace letters with the following rules:

- 1st letter E goes to next letter after E in alphabet: F
- 2nd letter N goes to previous letter before N in alphabet: M
- 3rd letter R goes to next letter after R in alphabet: S
...
(right-to-left, for the 1st letter always start with next letter in alphabet, then for every new letter previous, next, previous, next ...)
- if a letter is A, the previous letter is Z
- if a letter is Z, the next letter is A

E N R S E    E R V G O    A I H R T
F M S R F    D S U H P    Z J I Q U

(4) convert letters into numbers - A is 1 B is 2 Z is 26:

6 13 19 18 6 4 19 21 8 16 26 10 9 17 21

(5) skip first digit if there are 2

6 3 9 8 6 4 9 1 8 6 6 0 9 7 1

2. Sounds like a fun puzzle, I'm up for the challenge. Hopefully I can get something for you within the hour.

3. Wow - thanks for your help again, Sumo!

4. Here you go, Wodjanoi! It was a lot of fun trying to figure out your puzzle. You actually made a slight mistake when switching the letters from left to right:

E N R S E    E R V G O    A I H R T
F M S R F    D S U H N    B H I Q U

On the last letter of the second word, you didnt switch to left and went right twice, so the rest of the string is a bit messed up. You explained your thought process well enough though so I understood what you wanted.

All you need to do to add this to your program/game is to copy the "Code Conversion Widget" active object and the string parser 2 object. I made sure the string parser 2 object was compatible with all the runtimes so you shouldn't have a problem with it. All the variables are contained within the widget object so you don't need to copy any of the strings on the screen, those are just for show. You can retrieve the code conversion strings at every step of the process, they're stored within the alterable strings of the widget object.

5. That's a great example, Sumo. Thanks a ton! Sorry for my mistakes - Well, now with your example, I don't have to care about mistakes any longer.
Everything is working properly with small letters and spaces between the words and that's fine!
I noticed one little problem though - sometimes it's only a 14-digit number or even less numbers, because 0 is missing under certain conditions.
Put paper glass steel into the textbox for example and you will notice, that 0 is missing or try tzrue fhgdw ehwne.

Nevermind - you already fixed it.
Thanks again!

6. I made a few more tweaks, so I think this should work now. I moved all the code into a behavior too, so the code is contained within the active object widget. Let me know if you find anymore bugs.

Some of the zeroes were missing because they were at the start of the number phrase and Fusion deemed the 0 unnecessary since I stored it in an alterable value. I switched it to an alterable string to keep the zeroes from dropping.

7. ## Help with your code

Originally Posted by Sumo
I made a few more tweaks, so I think this should work now. I moved all the code into a behavior too, so the code is contained within the active object widget. Let me know if you find anymore bugs.

Some of the zeroes were missing because they were at the start of the number phrase and Fusion deemed the 0 unnecessary since I stored it in an alterable value. I switched it to an alterable string to keep the zeroes from dropping.
I know this is an old thread but how could I convert the numbers back into the string?

8. You can't precisely as the first digit is ignored. You can always take a guess but then you'd have to guess for each number.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•