diff options
| author | Sebastiano Tronto <sebastiano.tronto@gmail.com> | 2020-07-27 15:55:46 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano.tronto@gmail.com> | 2020-07-27 15:55:46 +0200 |
| commit | 39a5ef697479b56db0ac69ef00e0735e51f6150a (patch) | |
| tree | ad68a16b16a0a0b6e0a3319b8d8531a56b026937 | |
| parent | 5ca725cdd08814791bd57f30e5066d63cc7babc1 (diff) | |
| download | nissy-39a5ef697479b56db0ac69ef00e0735e51f6150a.tar.gz nissy-39a5ef697479b56db0ac69ef00e0735e51f6150a.zip | |
added command clear
| -rw-r--r-- | docs/clear.txt | 9 | ||||
| -rw-r--r-- | docs/pre.txt | 18 | ||||
| -rwxr-xr-x | nissy | bin | 171912 -> 521128 bytes | |||
| -rw-r--r-- | src/main.c | 12 |
4 files changed, 20 insertions, 19 deletions
diff --git a/docs/clear.txt b/docs/clear.txt new file mode 100644 index 0000000..8ba961a --- /dev/null +++ b/docs/clear.txt | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | |||
| 2 | HELP PAGE FOR COMMAND clear | ||
| 3 | |||
| 4 | SYNTAX | ||
| 5 | clear | ||
| 6 | |||
| 7 | DESCRIPTION | ||
| 8 | Resets all saved scrambles and output sequences. | ||
| 9 | |||
diff --git a/docs/pre.txt b/docs/pre.txt deleted file mode 100644 index c2cfd96..0000000 --- a/docs/pre.txt +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | |||
| 2 | HELP PAGE FOR COMMAND pre | ||
| 3 | |||
| 4 | SYNTAX | ||
| 5 | pre [MOVES|$ID1|@ID1] $ID2 | ||
| 6 | |||
| 7 | DESCRIPTION | ||
| 8 | Prepends either MOVES, the scramble memorized under $ID1 or the output sequence | ||
| 9 | memorized under @ID1 at the beginning of the scramble memorized under $ID2. If | ||
| 10 | none of MOVES, $ID1 or @ID1 is specified, the user will be asked to type the | ||
| 11 | moves. | ||
| 12 | Menmonic: "pre(pend) x to y" or just "pre(pend) to y". | ||
| 13 | |||
| 14 | EXAMPLES | ||
| 15 | add $1 | ||
| 16 | The user is required to type the moves that will be prepended to $1. | ||
| 17 | add F R B $1 | ||
| 18 | Prepends the moves F R B to scramble $1. Now scramble $1 begins with F R B. | ||
| Binary files differ | |||
| @@ -32,6 +32,8 @@ char *commands[][10] = { | |||
| 32 | "Solves a scramble."}, | 32 | "Solves a scramble."}, |
| 33 | {"replace", "[MOVES|$ID|@ID]", | 33 | {"replace", "[MOVES|$ID|@ID]", |
| 34 | "Find non-optimal subsequences."}, | 34 | "Find non-optimal subsequences."}, |
| 35 | {"clear", "", | ||
| 36 | "Delete saved scrambles and output sequences."}, | ||
| 35 | {"eo", "[MOVES|$ID|@ID]", | 37 | {"eo", "[MOVES|$ID|@ID]", |
| 36 | "Solves EO."}, | 38 | "Solves EO."}, |
| 37 | {"dr", "[MOVES|$ID|@ID]", | 39 | {"dr", "[MOVES|$ID|@ID]", |
| @@ -459,6 +461,14 @@ void replace_cmd(int n, char cmdtok[][100]) { | |||
| 459 | } | 461 | } |
| 460 | } | 462 | } |
| 461 | 463 | ||
| 464 | void clear_cmd(int n, char cmdtok[][100]) { | ||
| 465 | if (n > 1 || cmdtok[0][0] != 'c') { /* Avoid unused variable warning */ | ||
| 466 | printf("clear: syntax error.\n"); | ||
| 467 | return; | ||
| 468 | } | ||
| 469 | scr_count = tmp_count = 1; | ||
| 470 | } | ||
| 471 | |||
| 462 | void eo_cmd(int n, char cmdtok[][100]) { | 472 | void eo_cmd(int n, char cmdtok[][100]) { |
| 463 | 473 | ||
| 464 | /* Default values */ | 474 | /* Default values */ |
| @@ -818,7 +828,7 @@ void exit_quit_cmd(int n, char cmdtok[][100]) { | |||
| 818 | void (*cmd_list[])(int n, char cmdtok[][100]) = { | 828 | void (*cmd_list[])(int n, char cmdtok[][100]) = { |
| 819 | help_cmd, scramble_cmd, save_cmd, change_cmd, print_cmd, | 829 | help_cmd, scramble_cmd, save_cmd, change_cmd, print_cmd, |
| 820 | add_cmd, invert_cmd, unniss_cmd, pic_cmd, | 830 | add_cmd, invert_cmd, unniss_cmd, pic_cmd, |
| 821 | solve_cmd, replace_cmd, | 831 | solve_cmd, replace_cmd, clear_cmd, |
| 822 | eo_cmd, dr_cmd, htr_cmd, | 832 | eo_cmd, dr_cmd, htr_cmd, |
| 823 | drfinish_cmd, htrfinish_cmd, drcorners_cmd, | 833 | drfinish_cmd, htrfinish_cmd, drcorners_cmd, |
| 824 | exit_quit_cmd, exit_quit_cmd, NULL | 834 | exit_quit_cmd, exit_quit_cmd, NULL |
