move here
This commit is contained in:
commit
5705f52a2e
|
|
@ -0,0 +1,18 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_putchar.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/08 03:56:34 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/08 05:15:35 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
void ft_putchar(char c)
|
||||||
|
{
|
||||||
|
write(1, &c, 1);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_print_alphabet.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/08 06:23:17 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/08 07:18:24 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
void ft_print_alphabet(void)
|
||||||
|
{
|
||||||
|
write(1, "abcdefghijklmnopqrstuvwxyz", 26);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_print_reverse_alphabet.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/08 18:26:45 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/08 19:29:05 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
void ft_print_reverse_alphabet(void)
|
||||||
|
{
|
||||||
|
char z;
|
||||||
|
|
||||||
|
z = 'z';
|
||||||
|
while (z >= 'a')
|
||||||
|
{
|
||||||
|
write(1, &z, 1);
|
||||||
|
z--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_print_numbers.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/08 21:09:58 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/10 18:49:02 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
void ft_print_numbers(void)
|
||||||
|
{
|
||||||
|
char num;
|
||||||
|
|
||||||
|
num = '0';
|
||||||
|
while (num <= '9')
|
||||||
|
{
|
||||||
|
write(1, &num, 1);
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_is_negative.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/08 23:59:05 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/09 00:07:04 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
void ft_putchar(char c)
|
||||||
|
{
|
||||||
|
write(1, &c, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ft_is_negative(int n)
|
||||||
|
{
|
||||||
|
if (n < 0)
|
||||||
|
{
|
||||||
|
ft_putchar('N');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ft_putchar('P');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* ft_print_comb.c :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: lfirmin <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/02/09 00:08:45 by lfirmin #+# #+# */
|
||||||
|
/* Updated: 2024/02/10 06:50:42 by lfirmin ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
void ft_print(int u, int d, int c)
|
||||||
|
{
|
||||||
|
if (u == '7')
|
||||||
|
{
|
||||||
|
write(1, &u, 1);
|
||||||
|
write(1, &d, 1);
|
||||||
|
write(1, &c, 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
write(1, &u, 1);
|
||||||
|
write(1, &d, 1);
|
||||||
|
write(1, &c, 1);
|
||||||
|
write(1, ",", 1);
|
||||||
|
write(1, " ", 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ft_print_comb(void)
|
||||||
|
{
|
||||||
|
int u;
|
||||||
|
int d;
|
||||||
|
int c;
|
||||||
|
|
||||||
|
u = '0';
|
||||||
|
d = '1';
|
||||||
|
c = '2';
|
||||||
|
while (u < ('7' + 1))
|
||||||
|
{
|
||||||
|
while (d < ('8' + 1))
|
||||||
|
{
|
||||||
|
while (c < ('9' + 1))
|
||||||
|
{
|
||||||
|
ft_print(u, d, c);
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
c = ++d +1;
|
||||||
|
}
|
||||||
|
d = ++u;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue