forgot an action

This commit is contained in:
Mylloon 2024-04-27 01:49:51 +02:00
parent 9edde0d297
commit 42af9013d4
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 14 additions and 4 deletions

View file

@ -7,9 +7,9 @@
<xs:element name="tortue">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="turn" type="xs:integer" />
<xs:element name="move" type="xs:positiveInteger" />
<xs:element name="line" type="xs:positiveInteger" />
<xs:element name="move" type="xs:positiveInteger" />
<xs:element name="turn" type="xs:integer" />
<!-- TODO: Store que si on a déja eu un line/move -->
<xs:element name="store" type="Empty" />

View file

@ -68,14 +68,24 @@
<xsl:variable name="action"
select="$interpretation[@member = current()]" />
<xsl:choose>
<!-- Déplacer -->
<!-- Ecrire -->
<!-- TODO: Si plusieurs <line /> se suivant on pourrait les additionner -->
<xsl:when test="matches($action, '^LINE \d+$')">
<move>
<line>
<xsl:value-of select="substring-after($action, 'LINE ')" />
</line>
</xsl:when>
<!-- Déplacer -->
<!-- TODO: Si plusieurs <move /> se suivant on pourrait les additionner -->
<xsl:when test="matches($action, '^MOVE \d+$')">
<move>
<xsl:value-of select="substring-after($action, 'MOVE ')" />
</move>
</xsl:when>
<!-- Tourner -->
<!-- TODO: Si plusieurs <turn /> se suivant on pourrait les additionner -->
<xsl:when test="matches($action, '^TURN -?\d+$')">
<turn>
<xsl:value-of select="substring-after($action, 'TURN ')" />