Skip to content

Instantly share code, notes, and snippets.

View ayaderaghul's full-sized avatar
🐉
Married to Anthony Gorman

Aya de Raghũl ayaderaghul

🐉
Married to Anthony Gorman
View GitHub Profile
#include <stdlib.h>
#include "libft.h"
char *ft_strmapi(char const *s, char (*f)(unsigned int, char))
{
unsigned long i;
unsigned long l;
char *str;
l = ft_strlen(s);
#include <stdlib.h>
void *ft_memalloc(size_t size)
{
char *tab;
size_t i;
tab = (char *)malloc(sizeof(char) * (size + 1));
if (tab == NULL)
return (tab);
static int skip_spaces(const char *s, int i)
{
while (s[i] == ' ' || (9 <= s[i] && s[i] <= 13) || s[i] == '\n')
++i;
return (i);
}
int ft_atoi(const char *str)
{
int i;
int ft_strcmp(const char *s1, const char *s2)
{
int i;
i = 0;
while (s1[i] || s2[i])
{
if (s1[i] != s2[i])
return ((unsigned char)s1[i] - (unsigned char)s2[i]);
++i;
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
char *ft_strnstr(const char *haystack, const char *needle, size_t len)
{
size_t i;
size_t j;
if (needle[0] == '\0')
#include "ft_list.h"
void ft_list_clear(t_list **begin_list)
{
t_list *tmp;
if (&*begin_list == 0)
return ;
while (*begin_list->next)
{
#include "ft_list.h"
t_list *ft_list_last(t_list *begin_list)
{
if (begin_list == 0)
return begin_list;
while (begin_list->next)
begin_list = begin_list->next;
return (begin_list);
}
@ayaderaghul
ayaderaghul / convert-input.c
Created February 17, 2018 18:54
sudoku: take input and print the matrix
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void ft_putchar(char c)
{
write(1, &c, 1);
}
int length(char *str)
@ayaderaghul
ayaderaghul / test.c
Last active February 17, 2018 17:42
print char array
#include <unistd.h>
void ft_putchar(c)
{
write(1, &c, 1);
}
void print_array(char *arr)
{
int x;
int y;
@ayaderaghul
ayaderaghul / convert-input.c
Last active February 17, 2018 16:00
sudoku: to get input and convert into array of numbers..
#include <stdio.h>
#include <stdlib.h>
int length(char *str)
{
int i;
i = 0;
while (str[i])
++i;
return (i);