Verify the checker
Getting input and validation
-
read arguments from argvbut only valid32-bitintegers -
check duplicates -
receive arguments via command line ( ./checker -i 500.in -p -o 500.out -e 500.ops -v)-
-i 500.in, a file with number (either on lines or separated by spaces), if not specified, then the stack elements shall come after the arguments. -
-ppause whenever usingpa(if-vis specified, then pausencurses, if not write some indicator to the file) -
-o 500.outwrite an output file (if name was not specified, default isfoobar.out) -
-e 500.outexport push_swap operations to a file (if name was not specified, default isfoobar.ops -
-vvisualising withncurses
-
Reading operators and process
-
read stack_afromargv[] -
read operators list from stdin -
verify each operator -
apply the list of operators on stack_a, any failure will stop the process, and output KO, otherwise it shall output OK
Edited by Anas Rchid