summaryrefslogtreecommitdiff
path: root/src/wall.mli
diff options
context:
space:
mode:
Diffstat (limited to 'src/wall.mli')
-rw-r--r--src/wall.mli52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/wall.mli b/src/wall.mli
new file mode 100644
index 0000000..59d8edb
--- /dev/null
+++ b/src/wall.mli
@@ -0,0 +1,52 @@
+
+
+(* Programmed by Jedidiah Barber *)
+(* Licensed under the Sunset License v1.0 *)
+
+
+module type Algebra =
+ sig
+ type t
+
+ val zero : t
+ val one : t
+
+ val add : t -> t -> t
+ val sub : t -> t -> t
+ val mul : t -> t -> t
+ val div : t -> t -> t
+
+ val to_string : t -> string
+ end
+
+
+
+module type S =
+ sig
+ type element
+ type wall
+
+ val create : dimx:int -> dimy:int -> init:element array -> wall
+
+ val x_length : wall -> int
+ val y_length : wall -> int
+
+ val has_value : wall -> x:int -> y:int -> bool
+
+ val get : wall -> x:int -> y:int -> element
+ val get_opt : wall -> x:int -> y:int -> element option
+
+ val last_nonzero_row : wall -> int
+
+ val to_string : wall -> string
+ val print : wall -> unit
+ val output : Stdlib.out_channel -> wall -> unit
+ val pp_print : Stdlib.Format.formatter -> wall -> unit
+ end
+
+
+
+module Make:
+ functor (A : Algebra) -> S with type element = A.t
+
+