Jump to content


Photo

Is This Possible?


  • Please log in to reply
4 replies to this topic

#1 Constanta

Constanta

    GMC Member

  • New Member
  • 116 posts

Posted 16 April 2010 - 03:01 AM

Well I made this "secret" code but I need to make a translator for it. The letters/numbers are just changed a little. For example: a -12 and 4-r and %-g. Is it possible? I was wandering of some window showing up and you type in the code and then it translate by checking each code and then giving you a translation. Like this.

319163
c9163
co63
con

Can you give me an example?
  • 0

#2 Vivi_IX

Vivi_IX

    GMC Member

  • GMC Member
  • 202 posts
  • Version:GM8

Posted 16 April 2010 - 03:32 AM

A way to do what you want is to use the string_replace_all().
text = get_string("Enter text to be translated","");
text = string_replace_all(text,"a","12");
text = string_replace_all(text,"4","r");
text = string_replace_all(text,"%","g");

show_message(text);

This example may not be exactly what you want but it will point you in the right direction.

Edited by Vivi_IX, 16 April 2010 - 03:33 AM.

  • 0

#3 Constanta

Constanta

    GMC Member

  • New Member
  • 116 posts

Posted 16 April 2010 - 03:42 AM

THANX

Yeah i need some improvement cuzz it's weird and some times messes up
  • 0

#4 Vivi_IX

Vivi_IX

    GMC Member

  • GMC Member
  • 202 posts
  • Version:GM8

Posted 16 April 2010 - 04:03 AM

Tell me exactly what the problem is or what you need.
  • 0

#5 Teardrop

Teardrop

    GMC Member

  • GMC Member
  • 38 posts

Posted 16 April 2010 - 08:19 AM

Tell me exactly what the problem is or what you need.


i don't know what the problem for him, but this code could lead to some unwanted results.
with string replace all you really risk replacing the same char position more then one time.

if "4" means "a" but "a" means "&"
first you will change all "4"s to "a"s, but then, all "a"s to "&"s, wven those that were "4"s and should stay "a"s.

T.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users