opam-version: “2.0” name: “sets” version: “1.0.0” build: [ [“make”] ] descr: “sets”
val rev_tup : ‘a * ‘b * ‘c -> ‘c * ‘b * ‘a val abs : int -> int val area : int *…
## How to use utop Utop is an incredibly useful tool to have when you’re writing OCaml. If you don’t already have it, you can…
(*The following functions have been provided for your convenience*) let rec map f xs = match xs with | [] -> [] | x ::…
open Funs (*************************************) (* Part 2: Three-Way Search Tree *) (*************************************) type int_tree = | IntLeaf | IntNode of int * int option * int_tree…
require_relative ‘../models/game_board’ require_relative ‘../models/ship’ require_relative ‘../models/position’ # return a populated GameBoard or nil # Return nil on any error (validation error or file opening error)…
class GameBoard attr_reader :max_row, :max_column def initialize(max_row, max_column) @max_row = max_row @max_column = max_column end # adds a Ship object to the GameBoard # returns…
open P3.Nfa open P3.Regexp let string_of_int_list lst = “[” ^ String.concat “;” (List.map string_of_int lst) ^ “]” let string_of_int_list_list lst = “[” ^ String.concat “;”…