val contains_elem: ‘a list -> ‘a -> bool val is_present: ‘a list -> ‘a -> int list val count_occ : ‘a list -> ‘a ->…
# Notes for Discussion Exercise #3 Surprise! We’re now done with Ruby and moving onto a new programming language: OCaml. This discussion will go over…
# Sets module ## `insert x a` – Type: `’a -> ‘a list -> ‘a list` – Description: Inserts `x` into the set `a`. –…
(*The following functions have been provided for your convenience*) let rec map f xs = match xs with | [] -> [] | x ::…
class PhoneBook def initialize end def add(name, number, is_listed) raise Exception, “Not implemented” end def lookup(name) raise Exception, “Not implemented” end def lookupByNum(number) raise Exception,…
(* IMPORTANT: YOU MAY NOT MODIFY THIS FILE! * OUR TESTS USE THE ORIGINAL VERSION. * YOUR CODE WILL NOT COMPILE IF YOU CHANGE THIS…
require_relative ‘input_controller’ require_relative ‘../models/game_board’ # =========================================== # =====DON’T modify the following code======= # =========================================== PLAYER_ONE = 1 PLAYER_TWO = 2 RANDOM_ATTACK_SIZE = 35 # GameController…
# First let’s do some general # code block practice # Given a hash, return # all values that are divisble # by 2. Assume…
(* IMPORTANT: YOU MAY NOT MODIFY THIS FILE! * OUR TESTS USE THE ORIGINAL VERSION. * YOUR CODE WILL NOT COMPILE IF YOU CHANGE THIS…
require “minitest/autorun” require_relative “../../src/disc2.rb” class PublicTests < Minitest::Test def setup @hash = {1=>3, 2=>4, 5=>5, 6=>7, 8=>8, 9=>10} @arr = [1,2,3,4] @arr2 = [1,2,3,4] @grader…