Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let mov_pos b =
- match b with
- [] -> []
- | (h::t) ->
- let board_size = find_board_size(b) in
- let pos = index(b, 0) in
- let real_pos = pos mod board_size in
- let narr = if real_pos > 0 then get_val(b, pos-1)::narr else narr in
- let narr = if real_pos < board_size-1 then get_val(b, pos+1)::narr else narr in
- let narr = if pos > board_size-1 then get_val(b, pos-board_size)::narr else narr in
- if pos < board_size*2 then get_val(b, pos+board_size)::narr else narr
- ;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement