piscine-rush01/ex00/main.c

41 lines
1.3 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/26 06:13:07 by tischmid #+# #+# */
/* Updated: 2023/03/26 18:51:24 by akarami ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include "include/main.h"
#include "include/backtrack.h"
int main(int argc, char **argv)
{
int n;
int *borders;
int **board;
board = 0;
n = 4;
borders = malloc(n * 4 * 4);
board = alloc_mem(board, n);
if (!handle_input(argc, argv, borders, n))
{
put_error();
return (1);
}
if (!backtrack(borders, board, n))
{
put_error();
return (1);
}
free_mem(borders, board, n);
return (0);
}
// TODO: get position