Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_putchar.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: stheo <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2018/09/01 14:18:02 by stheo #+# #+# */
- /* Updated: 2018/09/01 15:39:13 by stheo ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include <unistd.h>
- void ft_putchar(char c)
- {
- write(1, &c, 1);
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* main.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: stheo <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2018/09/01 14:19:22 by stheo #+# #+# */
- /* Updated: 2018/09/01 18:08:31 by stheo ### ########.fr */
- /* */
- /* ************************************************************************** */
- void ft_putchar(char c);
- void rush(int x, int y);
- int main()
- {
- rush(5, 5);
- return (0);
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* rush00.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: nguillet <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2018/09/01 15:17:15 by nguillet #+# #+# */
- /* Updated: 2018/09/01 18:03:43 by stheo ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include<unistd.h>
- void ft_putchar(char c);
- void ft_aff(int x, int y, int x1, int y1)
- {
- while (y <= y1)
- {
- while (x <= x1)
- {
- if (x == 1 && y == 1) ft_putchar('o'); // afficher premier caractere
- if (x > 1 && y == 1 && x != x1) ft_putchar('-'); // affiche les caracteres de la premiere ligne
- if (x == 1 && y > 1 && y != y1) ft_putchar('|'); // affiche les carateres de la premiere colone
- if (x > 1 && y > 1 && x != x1 && y != y1) ft_putchar(' ');// affiche les caracteres espace
- if (x == x1 && y == 1 && x > 1) ft_putchar('o'); // affiche le dernier caractere de la ligne pour y = 1
- if (y == y1 && x == 1 && y > 1) ft_putchar('o'); // affiche le dernier caractere de la colone pour x = 1
- if (y == y1 && x == x1 && y != 1 && x != 1) ft_putchar('o');// affiche le dernier caractere des dernieres lignes/colones
- if (x == x1 && y > 1 && y != y1 && x > 1)ft_putchar('|');// affiche les caracteres de la derniere colone
- if (y == y1 && x > 1 && x != x1 && y > 1)ft_putchar('-');// affiche les caracteres de la derniere ligne
- x++;
- }
- ft_putchar('\n');
- x = 1;
- y++;
- }
- }
- void rush(int x, int y)
- {
- if (x <= 0 || y <= 0)
- return ;
- ft_aff(1, 1, x, y);
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* rush01.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: nguillet <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2018/09/01 15:17:15 by nguillet #+# #+# */
- /* Updated: 2018/09/01 18:05:32 by stheo ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include<unistd.h>
- void ft_putchar(char c);
- void ft_aff(int x, int y, int x1, int y1)
- {
- while (y <= y1)
- {
- while (x <= x1)
- {
- if (x == 1 && y == 1) ft_putchar('/'); // afficher premier caractere
- if (x > 1 && y == 1 && x != x1) ft_putchar('*'); // affiche les caracteres d e la premiere ligne
- if (x == 1 && y > 1 && y != y1) ft_putchar('*'); // affiche les carateres de la premiere colone
- if (x > 1 && y > 1 && x != x1 && y != y1) ft_putchar(' ');// affiche les caracteres espace
- if (x == x1 && y == 1 && x > 1) ft_putchar('\\'); // affiche le dernier caractere de la ligne pour y = 1
- if (y == y1 && x == 1 && y > 1) ft_putchar('\\'); // affiche le dernier caractere de la colone pour x = 1
- if (y == y1 && x == x1 && y != 1 && x != 1) ft_putchar('/');// affiche le dernier caractere des dernieres lignes/colones
- if (x == x1 && y > 1 && y != y1 && x > 1)ft_putchar('*');// affiche les caracteres de la derniere colone
- if (y == y1 && x > 1 && x != x1 && y > 1)ft_putchar('*');// affiche les caracteres de la derniere ligne
- x++;
- }
- ft_putchar('\n');
- x = 1;
- y++;
- }
- }
- void rush(int x, int y)
- {
- if (x <= 0 || y <= 0)
- return ;
- ft_aff(1, 1, x, y);
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* rush02.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: nguillet <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2018/09/01 15:17:15 by nguillet #+# #+# */
- /* Updated: 2018/09/01 18:05:08 by stheo ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include<unistd.h>
- void ft_putchar(char c);
- void ft_aff(int x, int y, int x1, int y1)
- {
- while (y <= y1)
- {
- while (x <= x1)
- {
- if (x == 1 && y == 1) ft_putchar('A'); // afficher premier caractere
- if (x > 1 && y == 1 && x != x1) ft_putchar('B'); // affiche les caracteres d e la premiere ligne
- if (x == 1 && y > 1 && y != y1) ft_putchar('B'); // affiche les carateres de la premiere colone
- if (x > 1 && y > 1 && x != x1 && y != y1) ft_putchar(' ');// affiche les caracteres espace
- if (x == x1 && y == 1 && x > 1) ft_putchar('A'); // affiche le dernier caractere de la ligne pour y = 1
- if (y == y1 && x == 1 && y > 1) ft_putchar('C'); // affiche le dernier caractere de la colone pour x = 1
- if (y == y1 && x == x1 && y != 1 && x != 1) ft_putchar('C');// affiche le dernier caractere des dernieres lignes/colones
- if (x == x1 && y > 1 && y != y1 && x > 1)ft_putchar('B');// affiche les caracteres de la derniere colone
- if (y == y1 && x > 1 && x != x1 && y > 1)ft_putchar('B');// affiche les caracteres de la derniere ligne
- x++;
- }
- ft_putchar('\n');
- x = 1;
- y++;
- }
- }
- void rush(int x, int y)
- {
- if (x <= 0 || y <= 0)
- return ;
- ft_aff(1, 1, x, y);
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* rush03.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: nguillet <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2018/09/01 15:17:15 by nguillet #+# #+# */
- /* Updated: 2018/09/01 18:04:43 by stheo ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include<unistd.h>
- void ft_putchar(char c);
- void ft_aff(int x, int y, int x1, int y1)
- {
- while (y <= y1)
- {
- while (x <= x1)
- {
- if (x == 1 && y == 1) ft_putchar('A'); // afficher premier caractere
- if (x > 1 && y == 1 && x != x1) ft_putchar('B'); // affiche les caracteres d e la premiere ligne
- if (x == 1 && y > 1 && y != y1) ft_putchar('B'); // affiche les carateres de la premiere colone
- if (x > 1 && y > 1 && x != x1 && y != y1) ft_putchar(' ');// affiche les caracteres espace
- if (x == x1 && y == 1 && x > 1) ft_putchar('C'); // affiche le dernier caractere de la ligne pour y = 1
- if (y == y1 && x == 1 && y > 1) ft_putchar('A'); // affiche le dernier caractere de la colonepour x =1
- if (y == y1 && x == x1 && y != 1 && x != 1) ft_putchar('C');// affiche le dernier caractere des dernieres lignes/colones
- if (x == x1 && y > 1 && y != y1 && x > 1)ft_putchar('B');// affiche les caracteres de la de rniere colone
- if (y == y1 && x > 1 && x != x1 && y > 1)ft_putchar('B');// affiche les caracteres de la derniere ligne
- x++;
- }
- ft_putchar('\n');
- x = 1;
- y++;
- }
- }
- void rush(int x, int y)
- {
- if (x <= 0 || y <= 0)
- return ;
- ft_aff(1, 1, x, y);
- }
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* rush04.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: nguillet <marvin@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2018/09/01 15:17:15 by nguillet #+# #+# */
- /* Updated: 2018/09/01 18:06:02 by stheo ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include<unistd.h>
- void ft_putchar(char c);
- void ft_aff(int x, int y, int x1, int y1)
- {
- while (y <= y1)
- {
- while (x <= x1)
- {
- if (x == 1 && y == 1) ft_putchar('A'); // afficher premier caractere
- if (x > 1 && y == 1 && x != x1) ft_putchar('B'); // affiche les caracteres d e la premiere ligne
- if (x == 1 && y > 1 && y != y1) ft_putchar('B'); // affiche les carateres de la premiere colone
- if (x > 1 && y > 1 && x != x1 && y != y1) ft_putchar(' ');// affiche les caracteres espace
- if (x == x1 && y == 1 && x > 1) ft_putchar('C'); // affiche le dernier caractere de la ligne pour y = 1
- if (y == y1 && x == 1 && y > 1) ft_putchar('C'); // affiche le dernier caractere de la colonepour x =1
- if (y == y1 && x == x1 && y != 1 && x != 1) ft_putchar('A');// affiche le dernier caractere des dernieres lignes/colones
- if (x == x1 && y > 1 && y != y1 && x > 1)ft_putchar('B');// affiche les caracteres de la de rniere colone
- if (y == y1 && x > 1 && x != x1 && y > 1)ft_putchar('B');// affiche les caracteres de la derniere ligne
- x++;
- }
- ft_putchar('\n');
- x = 1;
- y++;
- }
- }
- void rush(int x, int y)
- {
- if (x <= 0 || y <= 0)
- return ;
- ft_aff(1, 1, x, y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement