init
This commit is contained in:
BIN
Rush/Rush00/ex00/a.out
Executable file
BIN
Rush/Rush00/ex00/a.out
Executable file
Binary file not shown.
20
Rush/Rush00/ex00/ft_putchar.c
Normal file
20
Rush/Rush00/ex00/ft_putchar.c
Normal file
@ -0,0 +1,20 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_putchar.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mchedota <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/07/15 18:08:06 by mchedota #+# #+# */
|
||||
/* Updated: 2022/07/16 09:56:02 by mchedota ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void ft_putchar(char c);
|
||||
|
||||
void ft_putchar(char c)
|
||||
{
|
||||
write(1, &c, 1);
|
||||
}
|
21
Rush/Rush00/ex00/main.c
Normal file
21
Rush/Rush00/ex00/main.c
Normal file
@ -0,0 +1,21 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* main.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mchedota <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/07/15 18:17:20 by mchedota #+# #+# */
|
||||
/* Updated: 2022/07/19 15:00:38 by cchauvet ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
void rush(int x, int y);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
rush(0, 0);
|
||||
return (0);
|
||||
}
|
41
Rush/Rush00/ex00/rush02.c
Normal file
41
Rush/Rush00/ex00/rush02.c
Normal file
@ -0,0 +1,41 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* rush02.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mchedota <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/07/15 18:18:02 by mchedota #+# #+# */
|
||||
/* Updated: 2022/07/16 10:02:11 by mchedota ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
void ft_putchar(char c);
|
||||
|
||||
void rush(int x, int y)
|
||||
{
|
||||
int flag_x;
|
||||
int flag_y;
|
||||
int test_x;
|
||||
|
||||
flag_y = 1;
|
||||
while (y >= flag_y)
|
||||
{
|
||||
flag_x = 1;
|
||||
while (x >= flag_x)
|
||||
{
|
||||
test_x = flag_x == 1 || flag_x == x;
|
||||
if (test_x && flag_y == 1)
|
||||
ft_putchar('A');
|
||||
else if (test_x && flag_y == y)
|
||||
ft_putchar('C');
|
||||
else if (test_x || (flag_y == 1 || flag_y == y))
|
||||
ft_putchar('B');
|
||||
else
|
||||
ft_putchar(' ');
|
||||
flag_x++;
|
||||
}
|
||||
ft_putchar('\n');
|
||||
flag_y++;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user