a java script version of the python treasure generator