From dbd56f01bed67099ee2696e9e13c7d01d420dbe0 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 10 Jan 2020 11:22:07 +0000 Subject: [PATCH] some corrections --- subjects/push-swap/push-swap.audit.en.md | 29 +++++++++++++----------- subjects/push-swap/push-swap.en.md | 21 ++++++++--------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/subjects/push-swap/push-swap.audit.en.md b/subjects/push-swap/push-swap.audit.en.md index 2de3a211..c43a5177 100644 --- a/subjects/push-swap/push-swap.audit.en.md +++ b/subjects/push-swap/push-swap.audit.en.md @@ -16,30 +16,31 @@ Error Error ``` ###### Does it display the right result as above? + ##### Try to run `"./push_swap <5 random numbers>"` with 5 random numbers instead of the tag. ###### Does it displays a valid solution and less than 12 instructions? -##### Try to run `"echo -e " " | ./checker "`. -###### Does it display the right result as above? + +##### Try to run `"./checker "` and input nothing. +###### Does it display nothing? + ##### Try to run `"./checker 0 one 2 3"`. ``` Error ``` ###### Does it display the right result as above? -##### Try to run `"./checker 1 2 2 3"`. -``` -Error -``` -###### Does it display the right result as above? + ##### Try to run `"echo -e "sa\npb\nrrr\n" | ./checker 0 9 1 8 2 7 3 6 4 5"`. ``` KO ``` ###### Does it display the right result as above? + ##### Try to run `"echo -e "pb\nra\npb\nra\nsa\nra\npa\npa\n" | ./checker 0 9 1 8 2"`. ``` OK ``` ###### Does it display the right result as above? + ##### Try to run `"ARG = "4 67 3 87 23"; ./push_swap $ARG | ./checker $ARG"`. ``` OK @@ -48,19 +49,21 @@ OK #### General -##### Try to run `"$ARG= "<100 random numbers>" ; ./push_swap $ARG"` with 100 random different numbers instead of the tag. -###### Does it displays less than 700 commands? -##### Try to run `"$ARG= "<100 random numbers> | ./checker $ARG" ; ./push_swap $ARG"` with the same 100 random different numbers as before instead of the tag. -###### Does it displays OK? +##### Try to run `"$ARG= "<100 random numbers>"; ./push_swap $ARG"` with 100 random different numbers instead of the tag. +###### +Does it displays less than 700 commands? +##### Try to run `"$ARG= "<100 random numbers>; ./push_swap $ARG | ./checker $ARG"` with the same 100 random different numbers as before instead of the tag. +``` +OK +``` +###### +Does it displays the right result as above? #### Basic ###### +Does the code obey the [good practices](https://github.com/01-edu/public/blob/master/subjects/good-practices.en.md)? - ###### +Is there a test file for this code? ###### +Are the tests checking each possible case? #### Social ###### +Did you learn anything from this project? -###### +Would you recommend/nominate this program as an example for the rest of the school? \ No newline at end of file +###### +Would you recommend/nominate this program as an example for the rest of the school? diff --git a/subjects/push-swap/push-swap.en.md b/subjects/push-swap/push-swap.en.md index 0d92853a..0808c61a 100644 --- a/subjects/push-swap/push-swap.en.md +++ b/subjects/push-swap/push-swap.en.md @@ -4,7 +4,7 @@ Push_swap is a very simple and highly effective algorithm.You have at your disposal a list of `int` values, two stacks (`a` and `b`) and a set of instructions. -You will have two write 2 programs: +You will have to write 2 programs: - **push_swap**, which calculates and displays on the standard output the smallest program using push_swap instruction language that sorts integer arguments received. - **checker**, which takes integer arguments and reads instructions on the standard output. Once read, checker executes them and displays `OK` if integers are sorted. Otherwise, it will display `KO`. @@ -28,7 +28,6 @@ These are the instructions that you can use to sort the stack : #### Example ```console ---------------------------------------- Init a and b : 2 1 @@ -86,7 +85,6 @@ Exec pa pa pa: 8 = = a b ---------------------------------------- ``` This project will help you learn about : @@ -116,6 +114,7 @@ pa pa student$ ./push_swap "0 one 2 3" Error +student$ ./push_swap student$ ``` @@ -128,6 +127,13 @@ student$ - In case of there are no arguments the program displays nothing. ```console +student$ ./checker "3 2 1 0" +sa +rra +pb +KO +student$ echo -e "rra\npb\nsa\n" | ./checker "3 2 one 0" +Error student$ echo -e "rra\npb\nsa\nrra\npa\n" rra pb @@ -136,14 +142,7 @@ rra pa student$ echo -e "rra\npb\nsa\nrra\npa\n" | ./checker "3 2 1 0" OK -student$ echo -e "sa\n\nrra\npb" -sa -rra -pb -student$ echo -e "sa\n\nrra\npb\n" | ./checker "3 2 1 0" -KO -student$ echo -e "sa\n\nrra\npb\n" | ./checker "3 2 one 0" -Error +student$ ./checker student$ ```