Compare commits
3 Commits
845e6dcb81
...
c0ba167a60
| Author | SHA1 | Date |
|---|---|---|
|
|
c0ba167a60 | |
|
|
534cd2e35c | |
|
|
2a13420ea1 |
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
18
ex00/main.c
18
ex00/main.c
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue