UsableSeed

From Esolang
Jump to: navigation, search

UsableSeed is a language based Seed. Programs only contain two instructions - length and random seed, separated by a space. To execute a Seed program, the seed is fed into a Mersenne Twister random number generator, and the randomness obtained is converted into a string of length bytes, which will be base64-decoded and executed by a 05AB1E interpreter.

Computational class

Since standard 05AB1E is Turing-complete, UsableSeed is Turing-complete too.

Running programs

Here is the Python 3.0 script that converts seed programs to 05AB1E:

import random
import base64
program="780 983247832" ##Place program here
program=program.split()
length=int(program[0])

random.seed(int(program[1]))
chars="".join(map(chr,range(32,127)))+'\n'
prog="".join([chars[int(random.random()*96)] for i in range(length)])

print("Your program:\n----------------------------------------\n", base64.decodestring(prog), "\n----------------------------------------\n")

This script was tested in two different computers to make sure it produces the same results. Other implementations MUST do so.