sans l'opion o opti les sames ne s'affichent pas

This commit is contained in:
Hugo LAMY
2019-05-28 13:05:14 +02:00
parent a9e62833bb
commit 77656ba113
7 changed files with 50 additions and 12 deletions

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/05/24 14:42:46 by hulamy #+# #+# */
/* Updated: 2019/05/27 19:31:53 by hulamy ### ########.fr */
/* Updated: 2019/05/28 13:03:46 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -62,7 +62,7 @@ int check_same_tetri(t_fillist *list, int num)
int i;
curr_tetri = list;
while (curr_tetri != NULL)
while (curr_tetri != NULL/* && list->dope[1]*/)
{
i = 0;
if (!(curr_tetri->memory =

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/05/27 13:46:29 by hulamy #+# #+# */
/* Updated: 2019/05/27 19:33:09 by hulamy ### ########.fr */
/* Updated: 2019/05/28 09:57:40 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -35,7 +35,7 @@ t_fillist *print_tetri(t_fillist *list)
print = tmp->same->tetribit;
print <<= 16;
ft_putstr("same --> ");
ft_putchar(tmp->same->letter);
ft_put_tetri_color(tmp->same->letter);
ft_putchar('\n');
}
ft_putchar('\n');

View File

@@ -6,7 +6,7 @@
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/01 13:29:05 by vmanzoni #+# #+# */
/* Updated: 2019/05/24 18:02:08 by hulamy ### ########.fr */
/* Updated: 2019/05/28 11:26:25 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -69,8 +69,9 @@ void check_file_errors(char *file, int *dope)
print_error_extended(1, dope);
else if (file[i] == '\n')
line_nbr++;
// le if suivant verifie quoi
if (file[i] == '\n' && line_nbr % 5 == 0 && file[i-1] != '\n')
print_error("error\n"); // est-ce que ca n'imprime pas error deux fois ??
print_error("error\n");
if (file[i] == '\n' && file[i+1] != '\0' && \
file[i+2] != '.' && file[i+2] != '#')
print_error_extended(2, dope);

View File

@@ -6,7 +6,7 @@
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/15 14:48:14 by vmanzoni #+# #+# */
/* Updated: 2019/05/27 19:43:06 by hulamy ### ########.fr */
/* Updated: 2019/05/28 10:44:43 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -144,10 +144,11 @@ int parse_input(char *input, t_fillist **list, int *dope)
while (j < 19)
tetri[j++] = input[i++];
tetri[19] = '\0';
// "wrong tetrimino" utile ?
if (check_tetri_errors(tetri))
print_error("error\n");
// print_error("error\n");
// print_error("error: Wrong tetrimino.\n");
// print_error_extended(check_tetri_errors(tetri));
print_error_extended(check_tetri_errors(tetri), dope);
add_to_list(tetri, list, letter++, dope);
while (input[i] && input[i] != '.' && input[i] != '#')
i++;

View File

@@ -6,7 +6,7 @@
/* By: hulamy <hulamy@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/27 20:47:22 by hulamy #+# #+# */
/* Updated: 2019/05/27 19:30:37 by hulamy ### ########.fr */
/* Updated: 2019/05/28 11:56:18 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -94,7 +94,8 @@ void add_remove(unsigned int *map, t_fillist *list, int size)
while (j >= list->position)
{
map[(j - 1) / 32] ^= (mask & tetri << (16 + i)) >> (j - 1);
map[(j - 1) / 32 + 1] ^= (mask & tetri << (16 + i)) << (32 - j) << 1;
if (map[(j - 1) / 32 + 1])
map[(j - 1) / 32 + 1] ^= (mask & tetri << (16 + i)) << (32 - j) << 1;
j -= size;
i -= list->width;
}

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.fillit</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@@ -6,7 +6,7 @@
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/01 13:34:46 by vmanzoni #+# #+# */
/* Updated: 2019/05/27 19:26:04 by hulamy ### ########.fr */
/* Updated: 2019/05/28 12:15:39 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -45,6 +45,21 @@
/*
** STRUCTURE
** tetribit : tetri ecrit en binaire dans un short de 16 bits
** width : largeur du tetri
** height : hauteur du tetri
** position : memorise la position d tetri bit a bit
** place : position sur l'axe des abscisses de la map (position % size)
** rank : position de 1 a 32 dans l'int du tableau d'int (position % 32)
** num : memorise dans quel int du tableau on se trouve (position / 32)
** total_num : le nombre d'int dans le tableau d'int
** test :
** letter :
** dope :
** memory :
** same :
** next :
** start :
*/
typedef struct s_fillist
{