spielplatz:student:42:cpisine_rush1
Inhaltsverzeichnis
Rush 01 with 3D Boxes
- Messagees for the User handeld in Main
- call function with first String (to validate Numberset)
- If not correct abort to Main return (1);
- function for loop and split the input by spaces
- function that read Characters and see it as Digit
- (or – Recursive /10 %10 for grater then Zero as positiv unsigned int)
- can we validate the Arraysize default 4x4x4Grid and SetSitzeFunc
- optional (3. map sizes up to 9×9)
- create int box3dmatrix[][][] and call next step
- startsolve(int box3dmatrix[][][])
- easy Checks
- loop through the Matrix to validate all Inputs
- only solution is full validate call next
- loop through the Matrix and write the Input Digits to the Terminal
- back to main with return (0);
validated Ouput to the User
./rush01 "4 3 2 1 1 2 2 2 4 3 2 1 1 2 2 2" | cat -e 1 2 3 4$ 2 3 4 1$ 3 4 1 2$ 4 1 2 3$
Error Ouput to the User
- not just one Inputstring
- „Run with only one argument in double \“ quotation !!\n„
- no parameter or to many
- „run ./rush01 \“4 3 2 1 1 2 2 2 4 3 2 1 1 2 2 2\“\n„
- Validate and Solve Error (no Solution output)
- „Error in given Data. 4×4 Grid please!\n“
- 2D Terminal output try to reuse the „loop through the Matrix“
Functiondefinition
helper func
unsigned int digit2int(char character);char * int2chars(unsigned int value);int ft_putnbr(int nb); or digit_to_int;
int runcode(char *list_of_digits);int check_numbers(?);call func to convert and check >0 set Arraysizevoid create_3d_matrix(int size, int ***matrix );int easyvalidate(int matrix[][][]);int more_logic_checks(int matrix[][][]);int is_now_validated(int matrix[][][]);void printout2dterminal(int matrix[][][]); return 0;
/var/services/web/dokuwiki/data/pages/spielplatz/student/42/cpisine_rush1.txt · Zuletzt geändert: von itbs