From 17257b7970eea1b246eb7b4ae51f824dacbe71c7 Mon Sep 17 00:00:00 2001 From: Pelle Nilsson Date: Sun, 23 Jun 2013 23:58:48 +0200 Subject: [PATCH] Removed counter names from html and default templates. It didn't work for writing some things, even though often correct. --- examples/counters.gamebook | 17 +++++++++-------- expected/counters.debug | 8 ++++---- expected/counters.html | 20 ++++++++++---------- expected/counters.rtf | 16 ++++++++-------- expected/counters.tex | 12 ++++++------ expected/counters.txt | 12 ++++++------ templates/DEFAULT/death.txt | 1 - templates/DEFAULT/dec.txt | 1 - templates/DEFAULT/inc.txt | 1 - templates/DEFAULT/min.txt | 1 - templates/DEFAULT/set.txt | 1 - templates/html/atleast.html | 2 +- templates/html/dec.html | 2 +- templates/html/inc.html | 2 +- templates/html/lessthan.html | 2 +- templates/html/min.html | 2 +- templates/html/morethan.html | 2 +- templates/html/set.html | 2 +- todo.org | 6 +++--- 19 files changed, 53 insertions(+), 57 deletions(-) delete mode 100644 templates/DEFAULT/death.txt delete mode 100644 templates/DEFAULT/dec.txt delete mode 100644 templates/DEFAULT/inc.txt delete mode 100644 templates/DEFAULT/min.txt delete mode 100644 templates/DEFAULT/set.txt diff --git a/examples/counters.gamebook b/examples/counters.gamebook index e30c142..eaaf4f6 100644 --- a/examples/counters.gamebook +++ b/examples/counters.gamebook @@ -5,25 +5,26 @@ This example gamebook shows how to use counters. This is where the gamebook starts. We have counters for [count life]Life Points[/count] and for [count gold]Gold[/count]. You start the adventure with -[set life]10[/set] and [set gold]12[/set]. -You can never have less than [min gold]0[/min]. FIXME need to +[set life]10[/set] Life Points and [set gold]12[/set] Gold. +You can never have less than [min gold]0[/min] Gold. FIXME need to figure out best syntax for death when life points go below 1. Go to [[getgold]] to get more Gold or [[dangerous]] to lose some Life Points. * getgold -Congratulations, you found [inc gold]2[/gold]. -If you have less than [lessthan life]1[/lessthan], turn to [[auto death]]. +Congratulations, you found [inc gold]2[/gold] Gold. +If you have less than [lessthan life]1[/lessthan] Life Points, +turn to [[auto death]]. You can go to [[dangerous]] to lose some life or to [[losegold]] to drop -some gold. If you have at least [atleast gold]16[/atleast] you +some gold. If you have at least [atleast gold]16[/atleast] Gold you can turn to [[hurrah]]. If you have even more than -[morethan gold]16[/morethan] you can turn to [[rich]]. +[morethan gold]16[/morethan] Gold you can turn to [[rich]]. * dangerous -You lose [dec life]1[/dec]. +You lose [dec life]1[/dec] Life Points. You can go to [[getgold]] to get some Gold. * losegold -You drop [dec gold]5[/dec]. It should not be possible to +You drop [dec gold]5[/dec] Gold. It should not be possible to go below 0. Then go on to get gold at [[getgold]] or lose life at [[dangerous]]. * rich diff --git a/expected/counters.debug b/expected/counters.debug index 51b9aa6..c8fbdeb 100644 --- a/expected/counters.debug +++ b/expected/counters.debug @@ -6,11 +6,11 @@ Introduction Turn to 1 to begin. -1 (start) - This is where the gamebook starts. We have counters for [COUNT life]Life Points[/COUNT] and for [COUNT gold]Gold[/COUNT]. You start the adventure with [SET life]10[/SET] and [SET gold]12[/SET]. You can never have less than [MIN gold]0[/MIN]. FIXME need to figure out best syntax for death when life points go below 1. Go to 7 to get more Gold or 6 to lose some Life Points. +1 (start) - This is where the gamebook starts. We have counters for [COUNT life]Life Points[/COUNT] and for [COUNT gold]Gold[/COUNT]. You start the adventure with [SET life]10[/SET] Life Points and [SET gold]12[/SET] Gold. You can never have less than [MIN gold]0[/MIN] Gold. FIXME need to figure out best syntax for death when life points go below 1. Go to 7 to get more Gold or 6 to lose some Life Points. 2 (death) - Less than 1 Life Point means the adventure ends now. 3 (hurrah) - You have at least 16 gold. Go back to get some more at 7. 4 (rich) - You have more than 16 Gold. How nice. Go back to get some more at 7. -5 (losegold) - You drop [DEC gold]5[/DEC]. It should not be possible to go below 0. Then go on to get gold at 7 or lose life at 6. -6 (dangerous) - You lose [DEC life]1[/DEC]. You can go to 7 to get some Gold. -7 (getgold) - Congratulations, you found [INC gold]2[/INC]. If you have less than 1, turn to ((automatic))2. You can go to 6 to lose some life or to 5 to drop some gold. If you have at least 16 you can turn to 3. If you have even more than 16 you can turn to 4. +5 (losegold) - You drop [DEC gold]5[/DEC] Gold. It should not be possible to go below 0. Then go on to get gold at 7 or lose life at 6. +6 (dangerous) - You lose [DEC life]1[/DEC] Life Points. You can go to 7 to get some Gold. +7 (getgold) - Congratulations, you found [INC gold]2[/INC] Gold. If you have less than 1 Life Points, turn to ((automatic))2. You can go to 6 to lose some life or to 5 to drop some gold. If you have at least 16 Gold you can turn to 3. If you have even more than 16 Gold you can turn to 4. END DEBUG OUTPUT diff --git a/expected/counters.html b/expected/counters.html index 12f9400..177c295 100644 --- a/expected/counters.html +++ b/expected/counters.html @@ -44,10 +44,10 @@ This is where the gamebook starts. We have counters for Life Points and for Gold. You start the adventure with 10 Life Points and 12 Gold. You can never have less than 0 Gold -. FIXME need to figure out best syntax for death when life points go below 1. Go to 10 Life Points and 12 Gold. You can never have less than 0 + Gold. FIXME need to figure out best syntax for death when life points go below 1. Go to 7 to get more Gold or 6 to lose some Life Points. @@ -92,7 +92,7 @@ if (this.gamebook) {
5
You drop 5 Gold. It should not be possible to go below 0. Then go on to get gold at 5 Gold. It should not be possible to go below 0. Then go on to get gold at 7 or lose life at 6.
@@ -105,7 +105,7 @@ if (this.gamebook) {
6
You lose 1 Life Points. You can go to 1 Life Points. You can go to 7 to get some Gold.
@@ -117,14 +117,14 @@ if (this.gamebook) {
7
Congratulations, you found 2 Gold. If you have less than 1 Life Points, turn to 2 Gold. If you have less than 1 Life Points, turn to 2. You can go to 6 to lose some life or to 5 to drop some gold. If you have at least 16 Gold you can turn to 16 Gold you can turn to 3. If you have even more than 16 Gold you can turn to 16 Gold you can turn to 4.
diff --git a/expected/counters.rtf b/expected/counters.rtf index cf8a3ce..aef3919 100644 --- a/expected/counters.rtf +++ b/expected/counters.rtf @@ -23,9 +23,9 @@ \b \qc 1 \b0\ \ql This is where the gamebook starts. We have counters for Life Points and for Gold. You start the adventure with 10 Life Points - and 12 Gold -. You can never have less than 0 Gold -. FIXME need to figure out best syntax for death when life points go below 1. Go to \b 7 + Life Points and 12 Gold + Gold. You can never have less than 0 Gold + Gold. FIXME need to figure out best syntax for death when life points go below 1. Go to \b 7 \b0 to get more Gold or \b 6 \b0 @@ -54,7 +54,7 @@ \b \qc 5 \b0\ \ql You drop 5 Gold -. It should not be possible to go below 0. Then go on to get gold at \b 7 + Gold. It should not be possible to go below 0. Then go on to get gold at \b 7 \b0 or lose life at \b 6 \b0 @@ -64,7 +64,7 @@ \b \qc 6 \b0\ \ql You lose 1 Life Points -. You can go to \b 7 + Life Points. You can go to \b 7 \b0 to get some Gold. \ \ @@ -72,15 +72,15 @@ \b \qc 7 \b0\ \ql Congratulations, you found 2 Gold -. If you have less than 1, turn to \b 2 + Gold. If you have less than 1 Life Points, turn to \b 2 \b0 . You can go to \b 6 \b0 to lose some life or to \b 5 \b0 - to drop some gold. If you have at least 16 you can turn to \b 3 + to drop some gold. If you have at least 16 Gold you can turn to \b 3 \b0 -. If you have even more than 16 you can turn to \b 4 +. If you have even more than 16 Gold you can turn to \b 4 \b0 . \ \ diff --git a/expected/counters.tex b/expected/counters.tex index 960172c..059f521 100644 --- a/expected/counters.tex +++ b/expected/counters.tex @@ -49,9 +49,9 @@ Turn to 1 to begin. \noindent This is where the gamebook starts. We have counters for Life Points and for Gold. You start the adventure with 10 Life Points - and 12 Gold -. You can never have less than 0 Gold -. FIXME need to figure out best syntax for death when life points go below 1. Go to \textbf{\autoref{section7}} to get more Gold or \textbf{\autoref{section6}} to lose some Life Points. + Life Points and 12 Gold + Gold. You can never have less than 0 Gold + Gold. FIXME need to figure out best syntax for death when life points go below 1. Go to \textbf{\autoref{section7}} to get more Gold or \textbf{\autoref{section6}} to lose some Life Points. \vspace{1em} \phantomsection \refstepcounter{sectionnr} @@ -84,7 +84,7 @@ Turn to 1 to begin. \noindent You drop 5 Gold -. It should not be possible to go below 0. Then go on to get gold at \textbf{\autoref{section7}} or lose life at \textbf{\autoref{section6}}. + Gold. It should not be possible to go below 0. Then go on to get gold at \textbf{\autoref{section7}} or lose life at \textbf{\autoref{section6}}. \vspace{1em} \phantomsection \refstepcounter{sectionnr} @@ -93,7 +93,7 @@ Turn to 1 to begin. \noindent You lose 1 Life Points -. You can go to \textbf{\autoref{section7}} to get some Gold. + Life Points. You can go to \textbf{\autoref{section7}} to get some Gold. \vspace{1em} \phantomsection \refstepcounter{sectionnr} @@ -102,6 +102,6 @@ Turn to 1 to begin. \noindent Congratulations, you found 2 Gold -. If you have less than 1, turn to \textbf{\autoref{section2}}. You can go to \textbf{\autoref{section6}} to lose some life or to \textbf{\autoref{section5}} to drop some gold. If you have at least 16 you can turn to \textbf{\autoref{section3}}. If you have even more than 16 you can turn to \textbf{\autoref{section4}}. + Gold. If you have less than 1 Life Points, turn to \textbf{\autoref{section2}}. You can go to \textbf{\autoref{section6}} to lose some life or to \textbf{\autoref{section5}} to drop some gold. If you have at least 16 Gold you can turn to \textbf{\autoref{section3}}. If you have even more than 16 Gold you can turn to \textbf{\autoref{section4}}. \vspace{1em} \end{document} diff --git a/expected/counters.txt b/expected/counters.txt index 649a7ac..5f96422 100644 --- a/expected/counters.txt +++ b/expected/counters.txt @@ -8,9 +8,9 @@ Introduction Turn to 1 to begin. 1 This is where the gamebook starts. We have counters for Life Points and for Gold. You start the adventure with 10 Life Points - and 12 Gold -. You can never have less than 0 Gold -. FIXME need to figure out best syntax for death when life points go below 1. Go to 7 to get more Gold or 6 to lose some Life Points. + Life Points and 12 Gold + Gold. You can never have less than 0 Gold + Gold. FIXME need to figure out best syntax for death when life points go below 1. Go to 7 to get more Gold or 6 to lose some Life Points. 2 Less than 1 Life Point means the adventure ends now. @@ -23,13 +23,13 @@ Turn to 1 to begin. 5 You drop 5 Gold -. It should not be possible to go below 0. Then go on to get gold at 7 or lose life at 6. + Gold. It should not be possible to go below 0. Then go on to get gold at 7 or lose life at 6. 6 You lose 1 Life Points -. You can go to 7 to get some Gold. + Life Points. You can go to 7 to get some Gold. 7 Congratulations, you found 2 Gold -. If you have less than 1, turn to 2. You can go to 6 to lose some life or to 5 to drop some gold. If you have at least 16 you can turn to 3. If you have even more than 16 you can turn to 4. + Gold. If you have less than 1 Life Points, turn to 2. You can go to 6 to lose some life or to 5 to drop some gold. If you have at least 16 Gold you can turn to 3. If you have even more than 16 Gold you can turn to 4. diff --git a/templates/DEFAULT/death.txt b/templates/DEFAULT/death.txt deleted file mode 100644 index 098b9d5..0000000 --- a/templates/DEFAULT/death.txt +++ /dev/null @@ -1 +0,0 @@ -%(inner)s %(counter)s diff --git a/templates/DEFAULT/dec.txt b/templates/DEFAULT/dec.txt deleted file mode 100644 index 098b9d5..0000000 --- a/templates/DEFAULT/dec.txt +++ /dev/null @@ -1 +0,0 @@ -%(inner)s %(counter)s diff --git a/templates/DEFAULT/inc.txt b/templates/DEFAULT/inc.txt deleted file mode 100644 index 098b9d5..0000000 --- a/templates/DEFAULT/inc.txt +++ /dev/null @@ -1 +0,0 @@ -%(inner)s %(counter)s diff --git a/templates/DEFAULT/min.txt b/templates/DEFAULT/min.txt deleted file mode 100644 index 098b9d5..0000000 --- a/templates/DEFAULT/min.txt +++ /dev/null @@ -1 +0,0 @@ -%(inner)s %(counter)s diff --git a/templates/DEFAULT/set.txt b/templates/DEFAULT/set.txt deleted file mode 100644 index 098b9d5..0000000 --- a/templates/DEFAULT/set.txt +++ /dev/null @@ -1 +0,0 @@ -%(inner)s %(counter)s diff --git a/templates/html/atleast.html b/templates/html/atleast.html index 405afdd..c3423ef 100644 --- a/templates/html/atleast.html +++ b/templates/html/atleast.html @@ -1,2 +1,2 @@ %(inner)s %(counter)s \ No newline at end of file +>%(inner)s \ No newline at end of file diff --git a/templates/html/dec.html b/templates/html/dec.html index 9b9a1e5..9af7cc8 100644 --- a/templates/html/dec.html +++ b/templates/html/dec.html @@ -1,2 +1,2 @@ %(inner)s %(counter)s \ No newline at end of file + data-amount="%(inner)s">%(inner)s \ No newline at end of file diff --git a/templates/html/inc.html b/templates/html/inc.html index a7203e0..d6a907b 100644 --- a/templates/html/inc.html +++ b/templates/html/inc.html @@ -1,2 +1,2 @@ %(inner)s %(counter)s \ No newline at end of file + data-amount="%(inner)s">%(inner)s \ No newline at end of file diff --git a/templates/html/lessthan.html b/templates/html/lessthan.html index f7a30e0..b4d5862 100644 --- a/templates/html/lessthan.html +++ b/templates/html/lessthan.html @@ -1,2 +1,2 @@ %(inner)s %(counter)s \ No newline at end of file +>%(inner)s \ No newline at end of file diff --git a/templates/html/min.html b/templates/html/min.html index 4456ec6..ce80898 100644 --- a/templates/html/min.html +++ b/templates/html/min.html @@ -1,2 +1,2 @@ %(inner)s %(counter)s + data-limit="%(inner)s">%(inner)s diff --git a/templates/html/morethan.html b/templates/html/morethan.html index 3e1644a..afc3497 100644 --- a/templates/html/morethan.html +++ b/templates/html/morethan.html @@ -1,2 +1,2 @@ %(inner)s %(counter)s \ No newline at end of file +>%(inner)s \ No newline at end of file diff --git a/templates/html/set.html b/templates/html/set.html index 69894aa..e4e5fb5 100644 --- a/templates/html/set.html +++ b/templates/html/set.html @@ -1,2 +1,2 @@ %(inner)s %(counter)s \ No newline at end of file + data-amount="%(inner)s">%(inner)s \ No newline at end of file diff --git a/todo.org b/todo.org index 54cc57c..8e55d0b 100644 --- a/todo.org +++ b/todo.org @@ -1,4 +1,4 @@ -* TODO [49/72] [68%] +* TODO [51/75] [68%] - [X] Debug output - [X] DOT output - [X] LaTeX output @@ -61,8 +61,8 @@ - [X] Counters check - [X] Make sure HTML output works with javascript disabled and in inferior browsers -- [ ] Make sure counters start at 0 (not 1). -- [ ] Remove the counter names from counter-tags output (and templates). +- [X] Make sure counters start at 0 (not 1). +- [X] Remove the counter names from counter-tags output (and templates). - [ ] Buy (optionally decrease a counter to add something to a collection) buy tag to specify what can be bought, eg [buy item]sword[/buy] followed by cost tag to specify what it will cost, eg [cost gold]3[/cost]