# =========================================== # =====DON’T modify the following code======= # =========================================== class Position attr_reader :row, :column def initialize(row, column) @row = row @column = column end…
(***********************************) (* Part 1: Non-Recursive Functions *) (***********************************) let rev_tup tup = failwith “unimplemented” let abs x = failwith “unimplemented” let area x y =…
(library (name disc3)) (env (dev (flags (:standard -w -27-39-8-32))))
require_relative ‘controllers/game_controller’ # =========================================== # =====DON’T modify the following code======= # =========================================== Players = Struct.new(:game_board_1, :game_board_2, :attack_1, :attack_2) def parser(args) players = Players.new(nil, nil) raise…
open Funs (********************************) (* Part 1: High Order Functions *) (********************************) let contains_elem lst e = failwith “unimplemented” let is_present lst x = failwith “unimplemented”…
type int_tree = | IntLeaf | IntNode of int * int option * int_tree * int_tree * int_tree val empty_int_tree: int_tree val int_insert: int ->…
open P3.Nfa open P3.Regexp open OUnit2 let re_to_str r = let surround l = (“(” :: l) @ [“)”] in let rec r2str = function…
(*The functions we give you*) val map : (‘a -> ‘b) -> ‘a list -> ‘b list val foldl : (‘a -> ‘b -> ‘a)…
open List open Nfa (*********) (* Types *) (*********) type regexp_t = | Empty_String | Char of char | Union of regexp_t * regexp_t |…