42 lines
1.5 KiB
C
42 lines
1.5 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* main.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: jtorrez- <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/03/18 20:15:26 by jtorrez- #+# #+# */
|
|
/* Updated: 2023/03/18 23:45:18 by tischmid ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include <stdio.h>
|
|
#include "ft_lib.h"
|
|
#include "arghandle.h"
|
|
#include "rush00.h"
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
int width;
|
|
int max_width;
|
|
int height;
|
|
int max_height;
|
|
|
|
if (argc != 3)
|
|
{
|
|
wrong_argc(2, argc - 1);
|
|
usage(argv[0]);
|
|
return (1);
|
|
}
|
|
max_width = get_dim("cols", 200);
|
|
max_height = get_dim("lines", 200);
|
|
width = ft_atoi(argv[1]);
|
|
height = ft_atoi(argv[2]);
|
|
if (width > max_width)
|
|
return (wrong_dimension("width", max_width, width));
|
|
else if (height > max_height)
|
|
return (wrong_dimension("height", max_height - 3, height));
|
|
rush(width, height);
|
|
return (0);
|
|
}
|