もじぴったんのステージをXML文書にしてみた。
とりあえずこんな感じ。
1 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2 <Stage>
3 <String tokoroten="false">
4 <Endless>う</Endless>
5 <Once>あいえおかきくけこがぎぐげごさしすせそざじずぜぞたちつてとだぢづでどなにぬねのはひふへほばびぶべぼぱぴぷぺぽやゆよらりるれろわをんー</Once>
6 </String>
7 <Map width="9" height="6">
8 <Row>
9 <Cell group="0" reserved="true" value="う"/>
10 <Cell group="0"/>
11 <Cell group="0"/>
12 <Cell group="0"/>
13 <Cell group="0"/>
14 <Cell group="0"/>
15 <Cell group="0"/>
16 <Cell group="0" reserved="true" value="う"/>
17 </Row>
18 <Row>
19 <Empty/>
20 <Empty/>
21 <Empty/>
22 <Empty/>
23 <Cell/>
24 <Empty/>
25 <Empty/>
26 <Empty/>
27 <Empty/>
28 </Row>
29 <Row>
30 <Cell/>
31 <Cell/>
32 <Cell/>
33 <Cell/>
34 <Cell/>
35 <Cell/>
36 <Cell/>
37 <Cell/>
38 <Cell/>
39 </Row>
40 <Row>
41 <Cell/>
42 <Empty/>
43 <Empty/>
44 <Empty/>
45 <Cell/>
46 <Empty/>
47 <Empty/>
48 <Empty/>
49 <Cell/>
50 </Row>
51 <Row>
52 <Cell/>
53 <Empty/>
54 <Cell reserved="true" value="う"/>
55 <Empty/>
56 <Cell/>
57 <Empty/>
58 <Cell reserved="true" value="う"/>
59 <Empty/>
60 <Cell/>
61 </Row>
62 <Row>
63 <Cell/>
64 <Empty/>
65 <Empty/>
66 <Empty/>
67 <Cell/>
68 <Empty/>
69 <Empty/>
70 <Empty/>
71 <Cell/>
72 </Row>
73 <Row>
74 <Cell reserved="true" value="う"/>
75 <Empty/>
76 <Cell reserved="true" value="う"/>
77 <Empty/>
78 <Cell/>
79 <Empty/>
80 <Cell reserved="true" value="う"/>
81 <Empty/>
82 <Cell reserved="true" value="う"/>
83 </Row>
84 </Map>
85 <Condition>
86 <Word number="30" regex="う"/>
87 </Condition>
88 <Events/>
89 </Stage>
90
必要な要素はえらぶくんの文字列、マップ、クリア条件、回転・移動などのイベント。
んでもってスキーマはこちら。
1 <?xml version="1.0" encoding="utf-8"?>
2 <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
3 <xs:element name="Stage">
4 <xs:complexType>
5 <xs:sequence>
6 <xs:element name="String">
7 <xs:complexType mixed="true">
8 <xs:sequence>
9 <xs:sequence>
10 <xs:element name="Endless" type="xs:string" />
11 <xs:element name="Once" type="xs:string" />
12 </xs:sequence>
13 </xs:sequence>
14 <xs:attribute name="tokoroten" type="xs:boolean" default="false" use="optional" />
15 <xs:attribute name="window" type="xs:unsignedShort" default="0" use="optional" />
16 </xs:complexType>
17 </xs:element>
18 <xs:element name="Map">
19 <xs:complexType>
20 <xs:sequence>
21 <xs:sequence>
22 <xs:element maxOccurs="unbounded" name="Row">
23 <xs:complexType>
24 <xs:sequence>
25 <xs:choice maxOccurs="unbounded">
26 <xs:element maxOccurs="unbounded" name="Empty" />
27 <xs:element maxOccurs="unbounded" name="Cell">
28 <xs:complexType>
29 <xs:attribute name="group" type="xs:unsignedInt" use="optional" />
30 <xs:attribute name="enent" type="xs:string" use="optional" />
31 <xs:attribute name="reserved" type="xs:boolean" use="optional" />
32 <xs:attribute name="value" type="xs:string" use="optional" />
33 </xs:complexType>
34 </xs:element>
35 </xs:choice>
36 </xs:sequence>
37 </xs:complexType>
38 </xs:element>
39 </xs:sequence>
40 </xs:sequence>
41 <xs:attribute name="width" type="xs:unsignedByte" use="required" />
42 <xs:attribute name="height" type="xs:unsignedByte" use="required" />
43 </xs:complexType>
44 </xs:element>
45 <xs:element name="Condition">
46 <xs:complexType>
47 <xs:sequence>
48 <xs:choice>
49 <xs:element name="Block">
50 <xs:complexType>
51 <xs:sequence>
52 <xs:element name="number" type="xs:unsignedInt" />
53 </xs:sequence>
54 </xs:complexType>
55 </xs:element>
56 <xs:element name="Word">
57 <xs:complexType>
58 <xs:attribute name="length" type="xs:unsignedInt" />
59 <xs:attribute name="operator">
60 <xs:simpleType>
61 <xs:restriction base="xs:string">
62 <xs:enumeration value="Equal" />
63 <xs:enumeration value="EqualOrOver" />
64 </xs:restriction>
65 </xs:simpleType>
66 </xs:attribute>
67 <xs:attribute name="regex" type="xs:string" />
68 <xs:attribute name="number" type="xs:unsignedInt" use="required" />
69 </xs:complexType>
70 </xs:element>
71 <xs:element name="FillAll">
72 <xs:complexType>
73 <xs:sequence>
74 </xs:sequence>
75 </xs:complexType>
76 </xs:element>
77 <xs:element name="FillAt">
78 <xs:complexType>
79 <xs:sequence>
80 <xs:sequence>
81 <xs:element name="Point">
82 <xs:complexType>
83 <xs:sequence>
84 <xs:element name="x" type="xs:unsignedInt" />
85 <xs:element name="y" type="xs:unsignedInt" />
86 </xs:sequence>
87 </xs:complexType>
88 </xs:element>
89 </xs:sequence>
90 </xs:sequence>
91 </xs:complexType>
92 </xs:element>
93 </xs:choice>
94 </xs:sequence>
95 </xs:complexType>
96 </xs:element>
97 <xs:element name="Events">
98 <xs:complexType>
99 <xs:sequence>
100 <xs:element name="Event" minOccurs="0">
101 <xs:complexType>
102 <xs:sequence>
103 <xs:sequence>
104 <xs:choice>
105 <xs:element name="Turn">
106 <xs:complexType>
107 <xs:sequence>
108 <xs:element name="cx" type="xs:unsignedInt" />
109 <xs:element name="cy" type="xs:unsignedInt" />
110 </xs:sequence>
111 </xs:complexType>
112 </xs:element>
113 <xs:element name="Move">
114 <xs:complexType>
115 <xs:attribute name="dx" type="xs:int" use="required" />
116 <xs:attribute name="dy" type="xs:int" use="required" />
117 </xs:complexType>
118 </xs:element>
119 <xs:element name="Slide">
120 <xs:complexType>
121 <xs:sequence>
122 <xs:element name="origin">
123 <xs:simpleType>
124 <xs:restriction base="xs:string">
125 <xs:enumeration value="Up" />
126 <xs:enumeration value="Down" />
127 <xs:enumeration value="Left" />
128 <xs:enumeration value="Right" />
129 </xs:restriction>
130 </xs:simpleType>
131 </xs:element>
132 </xs:sequence>
133 </xs:complexType>
134 </xs:element>
135 </xs:choice>
136 </xs:sequence>
137 </xs:sequence>
138 <xs:attribute name="name" type="xs:string" use="required" />
139 </xs:complexType>
140 </xs:element>
141 </xs:sequence>
142 </xs:complexType>
143 </xs:element>
144 </xs:sequence>
145 </xs:complexType>
146 </xs:element>
147 </xs:schema>
148
もともとはGUIで作る予定だったけど面倒だったのでXMLに。
あとはこれを解釈して総当りで解かせるプログラムを組む予定。
辞書はもじぴったんのものは入手困難なのでフリーのもの。
うーん。結構難しそう。うまくいくかは五分五分といったところです。(汗
# むしめがねがクリアできないんだ~。