ne gere pas bien la cas d'un tetraminos sur une seul ligne

This commit is contained in:
Hugo LAMY
2019-04-15 16:21:04 +02:00
parent 8423652fb0
commit baa1a3de67
6 changed files with 24 additions and 11 deletions

Binary file not shown.

Binary file not shown.

BIN
a.out

Binary file not shown.

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.a.out</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>

Binary file not shown.

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/14 15:20:53 by hulamy #+# #+# */
/* Updated: 2019/04/15 16:06:37 by hulamy ### ########.fr */
/* Updated: 2019/04/15 16:14:46 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -87,7 +87,7 @@ int fill_list(char **square, t_fillist *list)
return (1);
}
int push_to_end(t_fillist **list)
int add_to_list(char **square, t_fillist **list)
{
t_fillist *tmp;
@@ -98,25 +98,18 @@ int push_to_end(t_fillist **list)
else
tmp->next = *list;
*list = tmp;
return (1);
}
int add_to_list(char **square, t_fillist **list)
{
if (!(push_to_end(list)))
return (0);
fill_list(square, *list);
return (1);
}
int main(int ac, char **av)
{
static t_fillist *list = NULL;
static t_fillist *list = NULL; // avant d'appeller add_to_list il faut declarer un pointeur static vers la structure
int i;
if (ac > 4)
{
add_to_list(++av, &list);
add_to_list(++av, &list); // l'appel de la fonction se fait avec un carre valide de 4*4 et l'adresse du pointeur vers la liste
if (ac == 9)
add_to_list(av += 4, &list);
while (list && (i = -1))