Idk
This commit is contained in:
parent
826f885936
commit
6b9b87010d
10
ex00/main.c
10
ex00/main.c
|
@ -6,7 +6,7 @@
|
|||
/* By: jtorrez- <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/03/18 20:15:26 by jtorrez- #+# #+# */
|
||||
/* Updated: 2023/03/19 17:20:41 by tischmid ### ########.fr */
|
||||
/* Updated: 2023/03/19 18:07:42 by tischmid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -21,26 +21,24 @@ void ft_putstr(char *str);
|
|||
// Also fails if the passed arguments are out of
|
||||
// bounds (200 for width, 100 for height).
|
||||
// argv[0] contains the path of the executable, eg ./rush00
|
||||
#include <stdio.h>
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int width;
|
||||
int height;
|
||||
|
||||
width = 5;
|
||||
height = 3;
|
||||
if (argc != 1 && argc != 3)
|
||||
{
|
||||
ft_putstr("Usage: ");
|
||||
ft_putstr(argv[0]);
|
||||
ft_putstr(" [WIDTH HEIGHT]\n");
|
||||
}
|
||||
if (argc == 1)
|
||||
if (argc == 3)
|
||||
{
|
||||
width = ft_atoi(argv[1]);
|
||||
height = ft_atoi(argv[2]);
|
||||
}
|
||||
else
|
||||
width = 5;
|
||||
height = 3;
|
||||
if (width >= 200)
|
||||
ft_putstr("Width must be less than 200\n");
|
||||
else if (height >= 100)
|
||||
|
|
BIN
ex00/rush00
BIN
ex00/rush00
Binary file not shown.
Loading…
Reference in New Issue