Browse Source

some corrections

pull/386/head
lee 5 years ago
parent
commit
dbd56f01be
  1. 29
      subjects/push-swap/push-swap.audit.en.md
  2. 21
      subjects/push-swap/push-swap.en.md

29
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?
###### +Would you recommend/nominate this program as an example for the rest of the school?

21
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$
```

Loading…
Cancel
Save