Benutzer-Werkzeuge

Webseiten-Werkzeuge


spielplatz:student:42:cpisine_rush1

Dies ist eine alte Version des Dokuments!


Rush 01 with 3D Boxes

  1. Messagees for the User handeld in Main
  2. call function with first String (to validate Numberset)
    1. If not correct abort to Main return (1);
  3. function for loop and split the input by spaces
    1. function that read Characters and see it as Digit
      1. (or – Recursive /10 %10 for grater then Zero as positiv unsigned int)
  4. can we validate the Arraysize default 4x4x4Grid and SetSitzeFunc
    1. optional (3. map sizes up to 9×9)
    2. create int box3dmatrix[][][] and call next step
  5. startsolve(int box3dmatrix[][][])
    1. easy Checks
    2. loop through the Matrix to validate all Inputs
      1. only solution is full validate call next
  6. loop through the Matrix and write the Input Digits to the Terminal
    1. 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

  1. int runcode(char *list_of_digits);
  2. int ft_putnbr(int nb); or digit_to_int;
  3. int check_numbers call func to convert and check >0 set Arraysize
  4. void create_3d_matrix(int size, int ***matrix );
  5. int easyvalidate(int matrix[][][]);
  6. int more_logic_checks(int matrix[][][]);
  7. int is_now_validated(int matrix[][][]);
  8. void printout2dterminal(int matrix[][][]); return 0;
/volume1/web/dokuwiki/data/attic/spielplatz/student/42/cpisine_rush1.1771074398.txt.gz · Zuletzt geändert: 2026/02/14 14:06 von itbs