Compare commits

...

3 Commits

Author SHA1 Message Date
Timo Schmidt c0ba167a60 Put headers into headerfile 2023-03-26 07:50:36 +02:00
Timo Schmidt 534cd2e35c Move comments 2023-03-26 07:45:58 +02:00
Timo Schmidt 2a13420ea1 Header 2023-03-26 07:45:37 +02:00
3 changed files with 10 additions and 17 deletions

View File

@ -6,14 +6,11 @@
/* By: smatthes <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/25 18:58:21 by smatthes #+# #+# */
/* Updated: 2023/03/26 06:57:31 by tischmid ### ########.fr */
/* Updated: 2023/03/26 07:47:58 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
int check_inp_valid(int argc, char **argv, int n);
int str_len(char *str);
void atoi_arr(char **argv, int *borders, int n);
int check_opposite_sum(int *borders, int n);
#include "include/handle_input.h"
int handle_input(int argc, char **argv, int *borders, int n)
{

View File

@ -6,7 +6,7 @@
/* By: smatthes <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/25 19:45:42 by smatthes #+# #+# */
/* Updated: 2023/03/26 06:58:14 by tischmid ### ########.fr */
/* Updated: 2023/03/26 07:27:15 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */

View File

@ -6,18 +6,14 @@
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/26 06:13:07 by tischmid #+# #+# */
/* Updated: 2023/03/26 06:58:29 by tischmid ### ########.fr */
/* Updated: 2023/03/26 07:44:16 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int **allo_mem(int **board, int n);
void free_mem(int *borders, int **board, int n);
int handle_input(int argc, char **argv, int *borders, int n);
void put_error(void);
#include "include/main.h"
int main(int argc, char **argv)
{
@ -28,12 +24,16 @@ int main(int argc, char **argv)
n = 4;
borders = malloc(n * 4 * 4);
board = allo_mem(board, n);
// handle sum of opposite inputs
if (handle_input(argc, argv, borders, n) == 0)
{
put_error();
return (1);
}
free_mem(borders, board, n);
return (0);
}
// TODO: get position
// handle sum of opposite inputs
/*
if (backtrack(borders, board, n) == 0)
{
@ -43,7 +43,3 @@ int main(int argc, char **argv)
print_stuff
*/
free_mem(borders, board, n);
return (0);
}
// TODO: get position