Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub struct Tree<Item, Count, Child>
- where
- Item: ComboItem,
- Count: Default,
- {
- min: Count,
- zero: Option<Child>,
- branches: Vec<Branch<Item, Count, Child>>,
- }
- struct Branch<Item: ComboItem, Count, Child> {
- head: Item::Head,
- child: Option<Child>,
- count: Count,
- }
- type Nil<T> = [T; 0];
- pub type Tree1<T, Count> = Tree<[T; 1], Count, Nil<T>>;
- pub type Tree2<T, Count> = Tree<[T; 2], Count, Tree1<T, Count>>;
- pub type Tree3<T, Count> = Tree<[T; 3], Count, Tree2<T, Count>>;
- pub type Tree4<T, Count> = Tree<[T; 4], Count, Tree3<T, Count>>;
- pub type Tree5<T, Count> = Tree<[T; 5], Count, Tree4<T, Count>>;
- pub type Tree6<T, Count> = Tree<[T; 6], Count, Tree5<T, Count>>;
- pub type Tree7<T, Count> = Tree<[T; 7], Count, Tree6<T, Count>>;
- pub type Tree8<T, Count> = Tree<[T; 8], Count, Tree7<T, Count>>;
- pub type Tree9<T, Count> = Tree<[T; 9], Count, Tree8<T, Count>>;
- pub type Tree10<T, Count> = Tree<[T; 10], Count, Tree9<T, Count>>;
- pub type Tree11<T, Count> = Tree<[T; 11], Count, Tree10<T, Count>>;
- pub type Tree12<T, Count> = Tree<[T; 12], Count, Tree11<T, Count>>;
- pub type Tree13<T, Count> = Tree<[T; 13], Count, Tree12<T, Count>>;
- pub type Tree14<T, Count> = Tree<[T; 14], Count, Tree13<T, Count>>;
- pub type Tree15<T, Count> = Tree<[T; 15], Count, Tree14<T, Count>>;
- pub type Tree16<T, Count> = Tree<[T; 16], Count, Tree15<T, Count>>;
- pub type Forest1<T, Count> = Tree1<T, Count>;
- pub type Forest2<T, Count> = (Tree2<T, Count>, Tree1<T, Count>);
- pub type Forest3<T, Count> = (Tree3<T, Count>, Forest2<T, Count>);
- pub type Forest4<T, Count> = (Tree4<T, Count>, Forest3<T, Count>);
- pub type Forest5<T, Count> = (Tree5<T, Count>, Forest4<T, Count>);
- pub type Forest6<T, Count> = (Tree6<T, Count>, Forest5<T, Count>);
- pub type Forest7<T, Count> = (Tree7<T, Count>, Forest6<T, Count>);
- pub type Forest8<T, Count> = (Tree8<T, Count>, Forest7<T, Count>);
- pub type Forest9<T, Count> = (Tree9<T, Count>, Forest8<T, Count>);
- pub type Forest10<T, Count> = (Tree10<T, Count>, Forest9<T, Count>);
- pub type Forest11<T, Count> = (Tree11<T, Count>, Forest10<T, Count>);
- pub type Forest12<T, Count> = (Tree12<T, Count>, Forest11<T, Count>);
- pub type Forest13<T, Count> = (Tree13<T, Count>, Forest12<T, Count>);
- pub type Forest14<T, Count> = (Tree14<T, Count>, Forest13<T, Count>);
- pub type Forest15<T, Count> = (Tree15<T, Count>, Forest14<T, Count>);
- pub type Forest16<T, Count> = (Tree16<T, Count>, Forest15<T, Count>);
- pub enum DynForest<T: ComboValue, Count: Countable> {
- Forest1(Forest1<T, Count>),
- Forest2(Forest2<T, Count>),
- Forest3(Forest3<T, Count>),
- Forest4(Forest4<T, Count>),
- Forest5(Forest5<T, Count>),
- Forest6(Forest6<T, Count>),
- Forest7(Forest7<T, Count>),
- Forest8(Forest8<T, Count>),
- Forest9(Forest9<T, Count>),
- Forest10(Forest10<T, Count>),
- Forest11(Forest11<T, Count>),
- Forest12(Forest12<T, Count>),
- Forest13(Forest13<T, Count>),
- Forest14(Forest14<T, Count>),
- Forest15(Forest15<T, Count>),
- Forest16(Forest16<T, Count>),
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement