let rec map f xs = match xs with | [] -> [] | x :: xt -> (f x)::(map f xt) let rec fold…
# =========================================== # =====DON’T modify the following code======= # =========================================== class Ship attr_reader :start_position, :orientation, :size def initialize(start_position, orientation, size) @start_position = start_position @orientation =…
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)…