1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! # MSR — Morpion Solitaire Record format
//!
//! A small, self-describing interchange format for [Morpion Solitaire] games:
//! the move list plus optional provenance (who/what/when produced it, how hard,
//! and a few derived facts), in either a compact `MS1:` envelope or plain JSON.
//! This crate is the reference reader, writer and **validator** for the format.
//!
//! It is deliberately self-contained — it does not depend on any solver — so any
//! tool can read, write and verify records with it. The published crate is
//! `morpion-solitaire-record`; it is imported as `msr`.
//!
//! ## Why MSR (vs. Pentasol)
//!
//! The community Pentasol text format covers only the 5T/5D variants and stores
//! moves alone. MSR is lossless for **all four** variants (4T/4D/5T/5D), carries
//! provenance metadata, and offers both a compact and a human-readable form. A
//! Pentasol bridge is provided for migration.
//!
//! ## Example
//!
//! ```
//! use msr::{Record, RecordMove, Variant, Direction};
//!
//! let moves = vec![RecordMove { x: 3, y: -1, dir: Direction::V, pos: 4 }];
//! let mut rec = Record::new(Variant::T5, moves);
//! rec.description = Some("a one-move demo".into());
//!
//! let compact = msr::encode(&rec).unwrap(); // "MS1:…"
//! let back = msr::decode(&compact).unwrap();
//! assert_eq!(rec, back);
//! ```
//!
//! ## Specification & references
//!
//! The normative format definition is the MSR specification shipped with the
//! source (`docs/spec/0.1/msr.md`) and the JSON Schema (`docs/spec/0.1/`). The rules
//! validated here are those of Morpion Solitaire; see the project bibliography
//! (`docs/BIBLIOGRAPHY.md`).
//!
//! [Morpion Solitaire]: https://en.wikipedia.org/wiki/Join_Five
pub use ;
pub use initial_cross;
pub use ;
pub use ;
/// The format version this crate reads and writes (the `version` field),
/// `major.minor`.
pub const FORMAT_VERSION: &str = "0.1";
/// The specification version implemented (`docs/spec/0.1/msr.md`).
pub const SPEC_VERSION: &str = "0.1";
/// Errors from encoding or decoding a record.