Graham van de Ruit

Editorial & information designer

  About   |   Links   |   Teaching   |

Random record selectors


I created this tool to select a competition winner from a database. The database is exported as text of the form name1,points.name2,points etc where the name is the name of an entrant and points is a number representing the number of points they have. More points correspond to a greater chance of being selected. The comma separates the entrant’s name from their points and the full stop separates each entrant’s record from the next. I have called these the secondary and primary delimiters and they can be substituted by any other glyph.

As an example, the string "lorraine,2.joseph,1.eunice,4. jackson,2" will create the array "lorraine, lorraine, joseph, eunice, eunice, eunice, eunice, jackson, jackson", out of which one element will be selected at random.