Advertisement
Guest User

Untitled

a guest
Jun 6th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.34 KB | None | 0 0
  1.     type StateTree =
  2.         | False
  3.         | True
  4.         | Node of StateTree[]
  5.  
  6.     let construct (domSize: int []) (state: int []) =
  7.         let rec loop i =
  8.             if i = state.Length
  9.             then True
  10.             else Node(Array.init (domSize.[i]) (fun j -> if state.[i] = j then loop (i + 1) else False))
  11.         loop 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement