Python Forum
Module for procedural generation with hashes
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Module for procedural generation with hashes
#2
I have found a flaw that will break seed-compatiblity.

If the tuple contains tuples, the join will not be deep. If you use semicolon separators, (1,(2,3)) will be flattened to the string "1;(2, 3)" since the join does not descend into the second tuple. It just takes the default stringification which is comma-and-space separated. Also the parentheses are not controllable, so this would create a key clash with the tuple (1,"(2, 3)").

I am going to fix this by doing a recursive flatten using custom parentheses and separators so that (1,(2,3)) can map to "1;{2;3}" and (1,"(2, 3)") to "1;(2, 3)" avoiding the hash clash.

Suggestions are welcome as to how to implement a recursive stringification!
https://stackoverflow.com/questions/4779...o-a-string
Reply


Messages In This Thread
RE: Module for procedural generation with hashes - by PhilHibbs - Dec-13-2017, 03:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Cute oscillating range generation snippet I saw on irc league55 1 2,825 Mar-26-2018, 04:19 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020