-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Última versão lista Basecamp-Reloaded
- Loading branch information
kechrist
committed
Apr 3, 2022
1 parent
fea1621
commit 61f53a2
Showing
25 changed files
with
504 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
find . -type f \( -name '*~' -o -name '#*# \) -print -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
find . -type f -name "*.sh" -exec basename {} .sh \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
ifconfig -a | grep ether | awk '{print $2}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_print_alphabet.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:11:05 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:11:13 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
void ft_putchar(char c); | ||
|
||
void ft_print_alphabet(void) | ||
{ | ||
char c; | ||
|
||
c = 96; | ||
while (++c < 123) | ||
ft_putchar(c); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_print_numbers.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:12:28 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:12:40 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
void ft_putchar(char c); | ||
|
||
void ft_print_numbers(void) | ||
{ | ||
char c; | ||
|
||
c = 47; | ||
while (++c < 58) | ||
ft_putchar(c); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_is_negative.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:14:15 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:14:34 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
void ft_putchar(char c); | ||
|
||
void ft_is_negative(int n) | ||
{ | ||
if (n >= 0) | ||
ft_putchar('P'); | ||
else | ||
ft_putchar('N'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_ft.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:15:27 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:15:46 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
void ft_ft(int *nbr) | ||
{ | ||
*nbr = 42; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_swap.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:16:35 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:16:49 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
void ft_swap(int *a, int *b) | ||
{ | ||
int swap; | ||
|
||
swap = *a; | ||
*a = *b; | ||
*b = swap; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_div_mod.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:17:54 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:17:59 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
void ft_div_mod(int a, int b, int *div, int *mod) | ||
{ | ||
*div = a / b; | ||
*mod = a % b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_iterative_factorial.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:18:58 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:19:27 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
int ft_iterative_factorial(int nb) | ||
{ | ||
int i; | ||
int response; | ||
|
||
i = 1; | ||
response = 1; | ||
if (nb < 0 || nb > 12) | ||
return (0); | ||
if (nb == 0 || nb == 1) | ||
return (1); | ||
while (i <= nb) | ||
{ | ||
response *= i; | ||
i++; | ||
} | ||
return (response); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_recursive_factorial.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:20:22 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:21:51 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
int ft_recursive_factorial(int nb) | ||
{ | ||
if (nb < 0 || nb > 12) | ||
return (0); | ||
else if (nb == 0 || nb == 1) | ||
return (1); | ||
else | ||
return (nb * ft_recursive_factorial(nb - 1)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_sqrt.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:21:56 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:24:43 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
int ft_sqrt(int nb) | ||
{ | ||
int i; | ||
|
||
i = 1; | ||
if (nb <= 0) | ||
return (0); | ||
while (i * i < nb) | ||
{ | ||
i++; | ||
if (i == 46340) | ||
break ; | ||
} | ||
if (i * i == nb) | ||
return (i); | ||
return (0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_putstr.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:25:59 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:26:19 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
void ft_putchar(char c); | ||
|
||
void ft_putstr(char *str) | ||
{ | ||
while (*str) | ||
ft_putchar(*str++); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_strlen.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:27:04 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:27:18 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
int ft_strlen(char *str) | ||
{ | ||
int i; | ||
|
||
i = -1; | ||
while (str[++i]) | ||
; | ||
return (i--); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_strcmp.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:28:07 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:28:27 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
int ft_strcmp(char *s1, char *s2) | ||
{ | ||
int i; | ||
|
||
i = 0; | ||
while (s1[i] == s2[i] && s1[i] != '\0' && s2[i] != '\0') | ||
i++; | ||
return (s1[i] - s2[i]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_print_params.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:29:11 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:29:27 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
void ft_putchar(char c); | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
int i; | ||
int j; | ||
|
||
i = 1; | ||
if (argc < 1) | ||
return (0); | ||
while (i < argc) | ||
{ | ||
j = 0; | ||
while (argv[i][j] != '\0') | ||
ft_putchar(argv[i][j++]); | ||
ft_putchar('\n'); | ||
i++; | ||
} | ||
return (0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* ft_sort_params.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: kechrist <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2022/04/03 23:30:02 by kechrist #+# #+# */ | ||
/* Updated: 2022/04/03 23:30:57 by kechrist ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
void ft_putchar(char c); | ||
|
||
void ft_putstr(char *str) | ||
{ | ||
while (*str) | ||
ft_putchar(*str++); | ||
} | ||
|
||
int ft_strcmp(char *s1, char *s2) | ||
{ | ||
int i; | ||
|
||
i = 0; | ||
while (s1[i] == s2[i] && s1[i] != !0 && s2[i] != !0) | ||
i++; | ||
return (s1[i] - s2[i]); | ||
} | ||
|
||
void ft_print_params(int argc, char **argv) | ||
{ | ||
int i; | ||
|
||
i = 1; | ||
while (i < argc) | ||
{ | ||
ft_putstr(argv[i++]); | ||
ft_putchar('\n'); | ||
} | ||
} | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
int i; | ||
char *swap; | ||
|
||
i = 1; | ||
if (argc > 1) | ||
{ | ||
while (i < argc - 1) | ||
{ | ||
if (ft_strcmp(argv[i], argv[i + 1]) > 0) | ||
{ | ||
swap = argv[i]; | ||
argv[i] = argv[i + 1]; | ||
argv[i + 1] = swap; | ||
i = 0; | ||
} | ||
i++; | ||
} | ||
ft_print_params(argc, argv); | ||
} | ||
return (0); | ||
} |
Oops, something went wrong.