Skip to content
Newer
Older
100644 45 lines (34 sloc) 1.53 KB
fccc685 Initial open-source release
MLstate authored
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 (*
19 @author Adam Koprowski
20 **)
21
22 open Base
23
24 let emph s = "" ^ s ^ ""
25 let strong s = "" ^ emph s ^ ""
26
27 let red s = "" ^ s ^ ""
28 let blue s = "" ^ s ^ ""
29 let green s = "" ^ s ^ ""
30
31 let emph_fmt fmt = "" ^^ fmt ^^ ""
32 let strong_fmt fmt = "" ^^ emph_fmt fmt ^^ ""
33 let blue_fmt s = "" ^^ s ^^ ""
34
35 let build_logger fn label format = fn (strong_fmt label ^^ " " ^^ format)
36
37 let walker () =
38 let size = 12 in
39 let seq = "o" in
40 let make_frame i j = Printf.sprintf "|%s%c%s|" (String.make i ' ') (String.get seq j) (String.make (size - i - 1) ' ') in
41 let make_entry i = List.init (String.length seq) (make_frame (if i >= size then 2*size - i - 2 else i)) in
42 let al = List.concat (List.init (size + size - 2) make_entry) in
43 let a = Array.map (fun s -> [| s |]) (Array.of_list al) in
44 ConsoleAnim.init ~och:stdout ~auto_walking:false a a
Something went wrong with that request. Please try again.