249 posts
Location
In the universe
Posted 27 October 2012 - 08:32 PM
Is there a way to turn words into numbers, and if there is, how?
Thanks
8543 posts
Posted 27 October 2012 - 08:33 PM
If you mean turning "one" into 1, you'd need a lookup table. If you mean turning "1" into 1, you need tonumber().
249 posts
Location
In the universe
Posted 27 October 2012 - 08:38 PM
but like "hello" into 4986
23 posts
Location
Equestria, TX
Posted 27 October 2012 - 08:40 PM
Also, there is something called coercion. Coercion in Lua basicly implies a type change during things like (addition | subtraction | division | multiplication).
EX:
> =( 1 + '1' + "1" )
3
(EDIT:
Seems like the forums didn't alert me to a new post…)
Edited on 27 October 2012 - 06:42 PM
818 posts
Posted 27 October 2012 - 08:42 PM
hello into 4986? why would that make sense?
249 posts
Location
In the universe
Posted 27 October 2012 - 08:45 PM
just an example :D/>/>
231 posts
Posted 27 October 2012 - 08:46 PM
Do you want each word to become a random number?
318 posts
Location
Somewhere on the planet called earth
Posted 28 October 2012 - 11:36 AM