
class Random:
	def __init__(self, seed):
		multiplier = 0x6C078965
		
		temp = seed
		self.state = []
		for i in range(1, 5):
			temp ^= temp >> 30
			temp = (temp * multiplier + i) & 0xFFFFFFFF
			self.state.append(temp)

	def u32(self):
		temp = self.state[0]
		temp = (temp ^ (temp << 11)) & 0xFFFFFFFF
		temp ^= temp >> 8
		temp ^= self.state[3]
		temp ^= self.state[3] >> 19
		self.state[0] = self.state[1]
		self.state[1] = self.state[2]
		self.state[2] = self.state[3]
		self.state[3] = temp
		return temp
	
	def uint(self, max):
		return (self.u32() * max) >> 32

@@ -27,16 +27,218 @@
 __(self,
+ *param):%0A%09%09if len(param) == 1: self.set_seed(param%5B0%5D)%0A%09%09elif len(param) == 4: self.set_state(*param)%0A%09%09else:%0A%09%09%09raise TypeError(%22Random.__init__ takes either 1 or 4 arguments%22)%0A%09%09%09%0A%09def set_seed(self,
  seed):%0A
@@ -417,16 +417,90 @@
 nd(temp)
+%0A%09%09%09%0A%09def set_state(self, s0, s1, s2, s3):%0A%09%09self.state = %5Bs0, s1, s2, s3%5D
 %0A%0A%09def u

Allow sead.Random to be constructed by internal state