fillit-tests now has its now git repo

This commit is contained in:
Jack Halford 2016-09-22 01:48:26 +02:00
parent d7b3560b93
commit 0abfe84d8c
51 changed files with 18 additions and 815 deletions

View file

@ -4,30 +4,28 @@ TAGFILE = .tags
D_SRC = src
F_SRC := $(shell ls -1 $(D_SRC) | grep "\.c$$")
DF_SRC := $(addprefix $(D_SRC)/, $(F_SRC))
D_OBJ = obj
F_OBJ = $(F_SRC:.c=.o)
F_OBJ := $(addprefix $(D_OBJ)/, $(F_OBJ))
DF_OBJ := $(addprefix $(D_OBJ)/, $(F_OBJ))
D_INC = includes
D_LIB = lib
D_LIB := $(shell find $(D_LIB) -maxdepth 1 -mindepth 1 -type d)
O_LIB := $(addprefix -L,$(D_LIB))
F_LIB = ft
F_LIB := $(addprefix -l, $(F_LIB))
W_FLAGS = -Wall -Wextra -Werror
D_FLAGS =
MKDIR = mkdir -p
RM = /bin/rm -rf
.PHONY: all clean fclean re tags lib/libft
.PHONY: all clean fclean re tags test
all: $(NAME) tags
all: libft/libft.a $(NAME) $(TAGFILE)
tags:
test:
gcc -Iincludes main.c libftprintf.a
$(TAGFILE): $(D_SRC)/*.c
@ctags -f $(TAGFILE) $(addprefix $(D_SRC)/, $(F_SRC))
@echo "Making tags..."
@ -36,11 +34,11 @@ $(D_OBJ)/%.o: $(D_SRC)/%.c $(D_INC)
@$(CC) -I$(D_INC) $(W_FLAGS) -c $< -o $@ $(D_FLAGS)
@echo "Compiling "$<"..."
$(D_LIB):
@$(MAKE) -C $@ 2>/dev/null
libft/libft.a:
@$(MAKE) -C libft/ 2>/dev/null
$(NAME): $(F_OBJ) $(D_LIB)
$(CC) -I$(D_INC) $(O_LIB) $(F_LIB) $(W_FLAGS) $(F_OBJ) -o $@ $(D_FLAGS)
$(NAME): $(DF_OBJ)
$(CC) -I$(D_INC) -Llibft -lft $(W_FLAGS) $(DF_OBJ) -o $@ $(D_FLAGS)
clean:
$(RM) $(D_OBJ)

1
fillit/includes/libft.h Symbolic link
View file

@ -0,0 +1 @@
../libft/libft.h

@ -1 +1 @@
Subproject commit 72cf308922bbfd4a3e86090522c83372d94c42b7
Subproject commit 9d74e941eec8de7e677407e7c362c6a7dc04eef8

View file

@ -20,10 +20,10 @@ int ft_validate_ttmn(t_ttmn ttmn)
while (++j < 4)
{
if (i != j
&& ((DIST(ttmn.pos[i][0], ttmn.pos[j][0]) == 0
&& DIST(ttmn.pos[i][1], ttmn.pos[j][1]) == 1)
|| (DIST(ttmn.pos[i][0], ttmn.pos[j][0]) == 1
&& DIST(ttmn.pos[i][1], ttmn.pos[j][1]) == 0)))
&& ((FT_DIST(ttmn.pos[i][0], ttmn.pos[j][0]) == 0
&& FT_DIST(ttmn.pos[i][1], ttmn.pos[j][1]) == 1)
|| (FT_DIST(ttmn.pos[i][0], ttmn.pos[j][0]) == 1
&& FT_DIST(ttmn.pos[i][1], ttmn.pos[j][1]) == 0)))
touch++;
}
}

View file

@ -1,59 +0,0 @@
....
.##.
.##.
....
.#..
.##.
.#..
....
....
..##
.##.
....
....
.##.
.##.
....
....
..#.
.##.
.#..
.###
...#
....
....
##..
.#..
.#..
....
....
.##.
.##.
....
....
..##
.##.
....
##..
.#..
.#..
....
.#..
.##.
..#.
....
....
###.
.#..
....

View file

@ -1,4 +0,0 @@
####
...#
....
....

View file

@ -1,4 +0,0 @@
...#
..#.
.#..
#...

View file

@ -1,4 +0,0 @@
##...
##...
....
....

View file

@ -1,3 +0,0 @@
#.
##
#.

View file

@ -1,4 +0,0 @@
....
....
....
....

View file

@ -1,4 +0,0 @@
..##
....
....
##..

View file

@ -1,4 +0,0 @@
####
####
####
####

View file

@ -1,4 +0,0 @@
,,,,
####
,,,,
,,,,

View file

@ -1,4 +0,0 @@
.HH.
HH..
....
....

View file

@ -1,4 +0,0 @@
....
.##.
.##.
....

View file

@ -1,4 +0,0 @@
....
....
....
####

View file

@ -1,4 +0,0 @@
....
#...
#...
##..

View file

@ -1,4 +0,0 @@
...#
..##
...#
....

View file

@ -1,20 +0,0 @@
...#
...#
...#
...#
....
....
....
####
.###
...#
....
....
....
..##
.##.
....

View file

@ -1,9 +0,0 @@
....
....
####
....
....
...
..##
..##

View file

@ -1,19 +0,0 @@
...#
...#
...#
...#
....
....
....
####
.###
...#
....
....
....
..##
.##.
....

View file

@ -1,9 +0,0 @@
#...
#...
#...
#...
##..
##..
....
....

View file

@ -1,19 +0,0 @@
....
##..
.#..
.#..
....
####
....
....
#...
###.
....
....
....
##..
.##.
....

View file

@ -1,39 +0,0 @@
...#
...#
...#
...#
....
....
....
####
.###
...#
....
....
....
..##
.##.
....
....
.##.
.##.
....
....
....
##..
.##.
##..
.#..
.#..
....
....
###.
.#..
....

View file

@ -1,44 +0,0 @@
....
.##.
.##.
....
...#
...#
...#
...#
....
..##
.##.
....
....
..#.
.##.
.#..
.###
...#
....
....
##..
.#..
.#..
....
....
..##
.##.
....
.#..
.##.
..#.
....
....
###.
.#..
....

View file

@ -1,54 +0,0 @@
....
.##.
.##.
....
...#
...#
...#
...#
....
..##
.##.
....
....
.##.
.##.
....
....
..#.
.##.
.#..
.###
...#
....
....
##..
.#..
.#..
....
....
..##
.##.
....
##..
.#..
.#..
....
.#..
.##.
..#.
....
....
###.
.#..
....

View file

@ -1,64 +0,0 @@
....
.##.
.##.
....
.##.
.#..
.#..
....
.#..
.##.
.#..
....
....
..##
.##.
....
....
.##.
.##.
....
....
..#.
.##.
.#..
.###
...#
....
....
##..
.#..
.#..
....
....
.##.
.##.
....
....
..##
.##.
....
##..
.#..
.#..
....
.#..
.##.
..#.
....
....
###.
.#..
....

View file

@ -1,124 +0,0 @@
....
.##.
.##.
....
.#..
.##.
.#..
....
....
..##
.##.
....
....
.##.
.##.
....
....
..#.
.##.
.#..
.###
...#
....
....
##..
.#..
.#..
....
....
..##
.##.
....
##..
.#..
.#..
....
.#..
.##.
..#.
....
...#
.###
....
....
....
###.
.#..
....
....
.##.
.##.
....
.#..
.##.
.#..
....
....
..##
.##.
....
....
.##.
.##.
....
....
..#.
.##.
.#..
.###
...#
....
....
##..
.#..
.#..
....
....
.##.
.##.
....
....
..##
.##.
....
##..
.#..
.#..
....
.#..
.##.
..#.
....
...#
.###
....
....
....
###.
.#..
....

View file

@ -1,129 +0,0 @@
....
.##.
.##.
....
.#..
.##.
.#..
....
....
..##
.##.
....
....
.##.
.##.
....
....
..#.
.##.
.#..
.###
...#
....
....
##..
.#..
.#..
....
....
.##.
.##.
....
....
..##
.##.
....
##..
.#..
.#..
....
.#..
.##.
..#.
....
...#
.###
....
....
....
###.
.#..
....
....
.##.
.##.
....
.#..
.##.
.#..
....
....
..##
.##.
....
....
.##.
.##.
....
....
..#.
.##.
.#..
.###
...#
....
....
##..
.#..
.#..
....
....
.##.
.##.
....
....
..##
.##.
....
##..
.#..
.#..
....
.#..
.##.
..#.
....
...#
.###
....
....
....
###.
.#..
....

View file

@ -1,2 +0,0 @@
./random_tetriminos.py $1
time ../fillit ttmnfile

View file

@ -1,19 +0,0 @@
#!/usr/bin/python
from __future__ import print_function
import sys, random, os
if (len(sys.argv) != 2):
print("Please provide one argument.")
sys.exit()
print ("Generating file with %s random tetriminos: " % sys.argv[1], end="")
os.chdir('tetriminos')
ttmns = os.listdir('.')
n_ttmns = len(ttmns)
rand_ind = [random.randrange(0, n_ttmns - 1) for _ in range(int(sys.argv[1]))]
# for i in indexes:
# print(ttmns[i].rstrip(), end="")
rand_ttmns = [ttmns[i].rstrip() for i in rand_ind]
print(', '.join(rand_ttmns))
command = "cat "+' '.join(rand_ttmns)+" | awk '1; NR % 4 == 0 {print \"\"}' | sed '$ d' > ../ttmnfile"
# print(command)
os.system(command)

View file

@ -1,4 +0,0 @@
#...
#...
#...
#...

View file

@ -1,4 +0,0 @@
####
....
....
....

View file

@ -1,4 +0,0 @@
.#..
.#..
##..
....

View file

@ -1,4 +0,0 @@
###.
..#.
....
....

View file

@ -1,4 +0,0 @@
##..
#...
#...
....

View file

@ -1,4 +0,0 @@
#...
###.
....
....

View file

@ -1,4 +0,0 @@
#...
#...
##..
....

View file

@ -1,4 +0,0 @@
..#.
###.
....
....

View file

@ -1,4 +0,0 @@
##..
.#..
.#..
....

View file

@ -1,4 +0,0 @@
###.
#...
....
....

View file

@ -1,4 +0,0 @@
##..
##..
....
....

View file

@ -1,4 +0,0 @@
.##.
##..
....
....

View file

@ -1,4 +0,0 @@
#...
##..
.#..
....

View file

@ -1,4 +0,0 @@
###.
.#..
....
....

View file

@ -1,4 +0,0 @@
#...
##..
#...
....

View file

@ -1,4 +0,0 @@
.#..
###.
....
....

View file

@ -1,4 +0,0 @@
.#..
##..
.#..
....

View file

@ -1,4 +0,0 @@
##..
.##.
....
....

View file

@ -1,4 +0,0 @@
.#..
##..
#...
....

View file

@ -1,59 +0,0 @@
.#..
.#..
##..
....
##..
#...
#...
....
.#..
.#..
##..
....
###.
.#..
....
....
##..
#...
#...
....
##..
#...
#...
....
###.
..#.
....
....
#...
##..
#...
....
.#..
.#..
##..
....
####
....
....
....
##..
.##.
....
....
###.
.#..
....
....