Rearranging String Characters

ShadowInTheD

Active Member
Reaction score
12
Is there an efficient way (like using loops) to switch string characters so they're much easier to fix and all work the same so that they don't conflict with each other?

i.e. string "ABCDEF" --> "FCEBDA"
 

ShadowInTheD

Active Member
Reaction score
12
What and how does it swap?

Oh wait.. So can the same characters that got swapped get red back for a save/load code?
 

ShadowInTheD

Active Member
Reaction score
12
No, it's actually that the randomness is a problem. I don't want it to be random at all, at least to where it can be decoded correctly. Because a random integer between 1 and 48 has a 1/48 chance of == a random integer between 1 and 48. Similarly if they actually consistently are the same ever time, what about 2 times? I want it to NOT be random so I can decode it.
 

ShadowInTheD

Active Member
Reaction score
12
Is there any other way I could do it? Maybe I just need more help with strings, THEY'RE SO ANNOYING.. It's stupid that the character positions aren't labeled, but rather the "gaps" between the characters.

Anyway, I'm looking more for like 15 character changes? Is there anyway to do that using a loop to do it all really fast?
 
Reaction score
341
Is there any other way I could do it? Maybe I just need more help with strings, THEY'RE SO ANNOYING.. It's stupid that the character positions aren't labeled, but rather the "gaps" between the characters.

Anyway, I'm looking more for like 15 character changes? Is there anyway to do that using a loop to do it all really fast?

Have you even tested my functions?

Test them, then tell me if you are satisfied.
 

ShadowInTheD

Active Member
Reaction score
12
I know exactly what they do (or at least should do). It just seems so inefficient to make like 15 functions and call them all.. isn't there a loop that can do it all in like 5 lines, instead of like 50?
 
Reaction score
341
Why are you afraid of performance in a Save/Load Code?

And if you did a loop, you would just be calling X amount of function however many times the loop runs.

I'll say it once more, try the functions, and tell me if you are satisfied.
 

ShadowInTheD

Active Member
Reaction score
12
It's not performance... I made like 10,000 mistakes doing it with just 10 lines of code, you CAN'T make "relative" mistakes using a loop. And decoding it is that much easier too.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
You want a completely random rearrangement?
Or you want it like in your first post where "Hello" would become "olleH"?
 

ShadowInTheD

Active Member
Reaction score
12
It shouldn't be random. It's for a Save/Load code, so it needs to not be random as it needs to be decrypted.
 

ShadowInTheD

Active Member
Reaction score
12
If I were going to randomly mix up characters, and save it with a random value, that would be kind of complex.. and regardless, doing it that way would REQUIRE a loop or like 239023850923 lines of code.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top