#Type that returns a random number

1 messages · Page 1 of 1 (latest)

barren phoenix
#

Does anyone have a idea about how to make a type that returns a random int, for example
type Rand<Min extends number, Max extends number, Seed extends number> = ...

fading shadow
#

no possible

#

also, it wouldn't be a random number if you'd get it's value as a type

floral basin
# fading shadow no possible

why do you say so? they want a PRNG so access to true randomness isn't necessary, and arithmetic and bit shifts and such can be encoded in the type system, so i'm sure a simple PRNG could be written

#

if the type system can run Doom it can run a PRNG 🚎

unreal rain
#

I'm actually just curious on what the use case for this is

rugged yew
#

probably some form of game in the type system