Re: Deterministic Randomness in Functional Clojure

2014-11-05 Thread Laurens Van Houtven
On 05 Nov 2014, at 04:22, Fluid Dynamics a2093...@trbvm.com wrote: Terminal emulation? In this day and age? Yes. Many people write and play explicitly retro games :-) hth lvh signature.asc Description: Message signed with OpenPGP using GPGMail

Re: Deterministic Randomness in Functional Clojure

2014-11-05 Thread Mikera
You may find that wrapping a random number generator as a lazy sequence is a useful approach - it is functional and works nicely in an idiomatic clojure style where you can take as many random numbers as you need while treating the whole sequence as an immutable value. I have an (experimental)

Re: Deterministic Randomness in Functional Clojure

2014-11-05 Thread blake
OK, I was using Lanterna as well, based on Steve Losh's Caves of Clojure series. On Tue, Nov 4, 2014 at 6:53 PM, Atamert Ölçgen mu...@muhuk.com wrote: clojure-lanterna is pretty cool. https://github.com/sjl/clojure-lanterna I'm interested in hearing about alternatives as well. On Wed,

Re: Deterministic Randomness in Functional Clojure

2014-11-05 Thread blake
On Tue, Nov 4, 2014 at 7:22 PM, Fluid Dynamics a2093...@trbvm.com wrote: On Tuesday, November 4, 2014 9:54:39 PM UTC-5, Atamert Ölçgen wrote: clojure-lanterna is pretty cool. https://github.com/sjl/clojure-lanterna I'm interested in hearing about alternatives as well. Terminal

Re: Deterministic Randomness in Functional Clojure

2014-11-04 Thread blake
Pardon my interruption: What are you using for screen output for your roguelike? On Tue, Oct 28, 2014 at 12:08 PM, Isaac Karth isaacka...@gmail.com wrote: I've been working on some projects (roguelikes, story-generators) that often have a reason to have a random outcome for things like

Re: Deterministic Randomness in Functional Clojure

2014-11-04 Thread Atamert Ölçgen
clojure-lanterna is pretty cool. https://github.com/sjl/clojure-lanterna I'm interested in hearing about alternatives as well. On Wed, Nov 5, 2014 at 4:09 AM, blake dsblakewat...@gmail.com wrote: Pardon my interruption: What are you using for screen output for your roguelike? On Tue, Oct

Re: Deterministic Randomness in Functional Clojure

2014-11-04 Thread Fluid Dynamics
On Tuesday, November 4, 2014 9:54:39 PM UTC-5, Atamert Ölçgen wrote: clojure-lanterna is pretty cool. https://github.com/sjl/clojure-lanterna I'm interested in hearing about alternatives as well. Terminal emulation? In this day and age? And a quick look around reveals no sign of mouse

Re: Deterministic Randomness in Functional Clojure

2014-11-03 Thread Rob Lally
It might also be worth noting that the JDK ships with java.security.SecureRandom a subclass of java.util.Random. http://docs.oracle.com/javase/8/docs/api/java/security/SecureRandom.html R. On 1 Nov 2014, at 10:31, Mars0i marsh...@logical.net wrote: On Friday, October 31, 2014

Re: Deterministic Randomness in Functional Clojure

2014-11-01 Thread Laurens Van Houtven
Hi Isaac, On 01 Nov 2014, at 05:19, Isaac Karth isaacka...@gmail.com wrote: Laurens, Using a PRF actually sounds very close to ideal for what I was looking for. If I can convert a map (or record) to a reproducible seed, and have that be independant from other random checks, that's pretty

Re: Deterministic Randomness in Functional Clojure

2014-11-01 Thread Mars0i
On Friday, October 31, 2014 11:19:19 PM UTC-5, Isaac Karth wrote: Looks like if I want to use libraries like clojure.data.generators or bigml.sampling I'd need to amend the random generators to replace calls to the Mersenne Twister function or (def ^:dynamic *rnd* (java.util.Random.

Re: Deterministic Randomness in Functional Clojure

2014-10-31 Thread Laurens Van Houtven
Hi, I too, am super interested in games in Clojure. My other background is cryptography, so I break out the crypto. I would say that you don’t really want a PRG, but you might want a PRF instead. (If that doesn’t mean anything to you, don’t worry, read on.) My favorite cryptographic hash

Re: Deterministic Randomness in Functional Clojure

2014-10-31 Thread Isaac Karth
Thanks for all of the feedback so far, it's been helpful. Mars0i, keeping an RNG for each thing that needs to have an independent random state seems like a good idea for a fallback, and the suggestion of using a different RNG is a good one. It's also helpful to know other people have dealt with

Re: Deterministic Randomness in Functional Clojure

2014-10-30 Thread Isaac Karth
How to handle messy relations with the world state is definitely something that could be better understood. Most models for game state I'm familiar with are highly object-oriented. [1] Figuring out how to approach it in Clojure, from a functional perspective seems to be an interesting challenge

Re: Deterministic Randomness in Functional Clojure

2014-10-30 Thread Mars0i
Isaac, I confess that I don't have any deep insights to offer about these architectural questions for your particular situation, but here are a few remarks that might be helpful for peripheral issues. In Clojure 1.6.0, at least, clojure.core/rand uses java.util.Random() (seeded by the system

Re: Deterministic Randomness in Functional Clojure

2014-10-28 Thread James Reeves
Hi Isaac It sounds to me that your source of pseudo-randomness is an inherent part of your world state, as without it you're unable to calculate the next state. You mention the problem of having to thread your PRNG through your functions, but I think the problem is broader than that. For