Hi everyone, this time I´m trying to get a string from InputRequester() into RandomSeed(), but I can´t figure out how to convert complete ASCII string to ASCII values and feed that into RandomSeed()
Does anybody know a slick way of performing this task?
I guess also that the input requester should be parsed as unicode instead, just in case,
I thought of using PeekS and a pointer to a variable and PokeL and a pointer to that same variable, but I´m not sure to know how it works
Thanks in advance !!!
String to long ?
- flaith
- Enthusiast
- Posts: 704
- Joined: Mon Apr 25, 2005 9:28 pm
- Location: $300:20 58 FC 60 - Rennes
- Contact:
Re: String to long ?
Should use syntax "Asc"
For a string, use this :
Code: Select all
debug Asc("A") ;will give you ascii code 65

For a string, use this :
Code: Select all
String$ = "Your string to convert in Ascii !!!"
For i = 1 To Len(String$)
Ascii = Asc(Mid(String$, i, 1))
; Put each value in a array for example
Debug Ascii
RandomSeed(Ascii)
Debug Chr(Random(Ascii))
Next
“Fear is a reaction. Courage is a decision.” - WC
Re: String to long ?
If you want the string itself as a seed, I suggest you use the CRC32Fingerprint of the string as a seed for RandomSeed.colguetti wrote:Hi everyone, this time I´m trying to get a string from InputRequester() into RandomSeed()
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
Re: String to long ?
Thank you guys, I´ll try to write some code based on this approaches tomorrow, now I´m fighting with a BSP-tree like map generator,
whenever I get it to work as intended, I´ll need the seed stuff for it...
Thank you very much !!!
whenever I get it to work as intended, I´ll need the seed stuff for it...
Thank you very much !!!