Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (**
- * Create a Tellstory module were dice will return results from dice_results
- *
- * @param dice_results int list
- * @return Tellstory module
- *)
- let make_module dice_results =
- let dice_calls = ref 0 in (* nr of times dice has been called *)
- let module T = Tellstory.Make(struct
- let dice n =
- let result = List.nth dice_results (!dice_calls) in
- dice_calls := !dice_calls + 1;
- result
- end)
- in T
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement