Skip to content

Commit b1ad92c

Browse files
Improve editing instructions in README.md
1 parent 3b0d478 commit b1ad92c

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,42 @@ A Grow adventure is comprised of scenes and begins at the starting scene. Each s
6262

6363
The patterns are case insensitive, and support regular expressions. A rule matches the user's input if any of the patterns for that rule can be found in the input. Because in most cases, a pattern is intended to match a whole word, before matching, all patterns are substituted into the regular expression `.*\b(%s)\b.*`, where `%s` is the uppercase version of the pattern. The program than searches for that regular expression in the uppercase version of the user's input. While it is not possible not make matching case sensitive, it is still possible to match parts of words by adding `.*` as a suffix or prefix to a pattern. For example, if you want to match any word that has `foo` in it, you could use the pattern `foo.*`, which when inserted into the expression above, becomes `.*\b(foo.*)\b.*`, and will match any word which starts with `foo`.
6464

65-
There are three main types of actions: print, go, and score. The print action prints text out to the user. It is denoted with either no prefix, or the prefix `p`. For example, the action `Right on!` would print out "Right on!", as would the action `pRight on!`. The go action changes the scene to a different scene. It is indicated by the prefix `g`. Thus, the action `gforest` would cause the game to go to the forest scene. The score action causes the users score to change. It has two prefixes: `+` and `-`. The action `+100` will increase the score by 100, and the action `-100` will decrease the score by 100.
65+
There are four main types of actions: print, go, change score, and display score. The print action prints text out to the user. It is denoted by the prefix `p`. For example, the action `pRight on!` would print out "Right on!". The go action changes the scene to a different scene. It is indicated by the prefix `g`. Thus, the action `gforest` would cause the game to go to the forest scene. The change score action causes the user's score to change. It has two prefixes: `+` and `-`. The action `+100` will increase the score by 100, and the action `-100` will decrease the score by 100. The display score action causes the program to display the player's current score. It is simply `s`.
6666

6767
## Gameplay
6868
When a player first visits a scene, the program displays the description for that scene, along with the associated media. The player can then type anything, and hit enter to submit their response. Then, the game analyzes the response. First, the game checks to see if the response is a command. If so, it executes that command. If the response is not a command, the game checks to see if any of the scene's rules match the command. The game then executes all the actions of the first rule that matches the user's input.
6969

7070
### Editing
7171
While playing Grow is fun, the real power of Grow is that it allows the player to modify the game during play. The main command for this is `extend`. When the player types the extend command, the program will ask the player for patterns to match. He can enter as many patterns as he wants, one per line, and then type a blank line when he is done. Then, the program will ask the player for actions to take when those patterns are matched in the user's input. Once again, the player can enter the actions, one per line, in the format described above, and then type a blank line when done.
7272

73-
Grow has several more editing commands which allow for editing the description of the current scene, changing the order of rules, and editing rules. All of those commands operate in a similar way to `extend`.
73+
Grow has several more editing commands which allow for editing the description of the current scene, changing the order of rules, and editing rules. The most useful are `edit` and `description`.
74+
75+
#### Edit
76+
The `edit` command allows the player to edit rules from the current scene. It first asks the user to pick a rule to edit. Then it displays three choices:
77+
78+
1. Edit patterns
79+
2. Edit actions
80+
3. Reorder actions
81+
82+
The pattern and action editing work in the same way. First, the game asks the user to pick a pattern or action to edit. Then, it asks for a replacement for that pattern or action. If the user is using the GUI mode, the game will put the text of the last pattern or action into the input field so the user can edit it. If the user is using the console mode, this will not happen because Java does not support it. Then, once the user hits enter, the program saves the new pattern or action. If the user deletes all the text and hits enter, the game removes that pattern or action. After the editing is complete, the game asks the user to enter any new patterns or actions, in the same way as the `extend` command.
83+
84+
The reordering of actions is simple: the program prints out a numbered list of the actions, and asks the user for a new order as a list of space-separated integers. For example, consider the following actions:
85+
86+
```
87+
1. pWhat is so hard about this?
88+
2. pI told you: you have to destroy the death star!!
89+
3. pIf you do not destroy the death star, the Empire may win
90+
```
91+
If the user typed in `1 2 3`, the order would not change, but if the user typed in `3 2 1` the order would be reversed.
92+
93+
#### Description
94+
The `description` command allows the user to change the description for the scene. If the user is using the GUI, the game will fill the input area with the last description.
95+
96+
#### Other Commands
97+
All the other commands operate in a similar way to one of the commands already described.
7498

7599
#Building
76-
Run `ant`.
100+
Run `ant` to produce a runnable jar. If you also want the documentation, you can use `ant doc`.
77101

78102
# License
79103
This program is licensed under GPLv3.0. A copy of the license is in `LICENSE.txt`.

0 commit comments

Comments
 (0)