Guest User

Untitled

a guest
Jan 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. fun reglist xs n = let
  2. val rownil = n div 3 * 3
  3. val rowone = rownil + 1
  4. val rowtwo = rowone + 1
  5.  
  6. val colnil = n mod 3 * 3
  7. val colone = colnil + 1
  8. val coltwo = colone + 1
  9. in
  10. [ List.nth((List.nth(xs, rownil)), colnil), List.nth((List.nth(xs, rownil)), colone), List.nth((List.nth(xs, rownil)), coltwo),
  11. List.nth((List.nth(xs, rowone)), colnil), List.nth((List.nth(xs, rowone)), colone), List.nth((List.nth(xs, rowone)), coltwo),
  12. List.nth((List.nth(xs, rowtwo)), colnil), List.nth((List.nth(xs, rowtwo)), colone), List.nth((List.nth(xs, rowtwo)), coltwo) ]
  13. end;
Add Comment
Please, Sign In to add comment