diff --git a/Makefile b/Makefile index c9ea04a..99fb4d8 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ endif # Compilator CC = gcc -FLAGS = -Wall -Wextra -Werror +FLAGS = -Wall -Wextra -Werror -g -O0 -fsanitize=address # Folders LIBDIR = libft @@ -36,7 +36,7 @@ OBJDIR = objs INCDIR = includes libft/includes # Source files -SRC = bfs.c \ +SRC = bfs.c lem_in.c lm_parser.c lm_mem_utils.c lm_graph_utils.c \ lst_ind.c \ edmunds_karp.c @@ -87,7 +87,7 @@ clean : fclean : clean @$(ECHO) "$(RED)===> $(GRE)$(NAME) : $(RED) Delete Binary File <===$(DEF)" - @$(RM) -f $(NAME1) $(NAME2) + @$(RM) -f $(NAME) $(NAME2) @$(RM) -rf *.dSYM @$(MAKE) -C $(LIBDIR) fclean diff --git a/author b/author index af15b88..e67d6a6 100644 --- a/author +++ b/author @@ -1,2 +1,2 @@ mndhlovu -tmaze \ No newline at end of file +tmaze diff --git a/includes/lem_in.h b/includes/lem_in.h index 66b13d2..2440833 100644 --- a/includes/lem_in.h +++ b/includes/lem_in.h @@ -14,6 +14,7 @@ # define LEM_IN_H # include "libft.h" +# include typedef struct s_node { @@ -22,6 +23,7 @@ typedef struct s_node int y; char role; int ind; + struct s_node *next; } t_node; typedef struct s_ind @@ -36,6 +38,7 @@ typedef struct s_lmdata int nbants; int nb_nodes; t_list *nodes; + t_node *nodes_data; t_ind **adj; } t_lmdata; @@ -46,9 +49,67 @@ typedef struct s_bfs int queue; } t_bfs; +//LEM_IN MT STRUCTS + +typedef struct s_syntax +{ + int nb_state; + int s_cmd; + int s_pos; + int s_vert; + int e_vert; + int gr_status; + int e_cmd; + int e_pos; + int v_flag; +} t_syntax; + +typedef struct s_adjnode +{ + int dest; + struct s_adjnode *next; +} t_adjnode; + +typedef struct s_adjlist +{ + t_adjnode *head; +} t_adjlist; + +typedef struct s_graph +{ + int vert; + t_adjlist *array; +} t_graph; + +typedef struct s_neighbour +{ + int vertnum; + struct s_neighbor *next; +} t_neighbor; + + + +//MT-FUNCTIONS +int lm_error_exit(int flag); +int lm_parser(int fd, t_syntax *synt, + t_lmdata *ldata, t_graph *graph); +void lm_init_data(t_syntax *synt, t_lmdata *ldata); +void lm_add_vertex(t_lmdata *ldata, char *raw, char flag); +t_adjnode *lm_new_node(int dest); +t_graph *lm_creategraph(int v); +void lm_add_edge(t_graph *graph, int src, int dest); +void lm_ext_conn(t_graph *graph, t_lmdata *data, char *raw, t_syntax *synt); +int lm_find_index(t_lmdata *data, char *str); + + + + + void lm_initdata(t_lmdata *data); int lm_getparams(t_lmdata *data); + + t_ind *lst_indadd(t_ind **lst, int ind); void lst_inddel(t_ind **lst); diff --git a/maps/.DS_Store b/maps/.DS_Store new file mode 100644 index 0000000..9957b6d Binary files /dev/null and b/maps/.DS_Store differ diff --git a/maps/big b/maps/big new file mode 100644 index 0000000..ea823f9 --- /dev/null +++ b/maps/big @@ -0,0 +1,3050 @@ +100 +##start +start 0 1 +##end +end 1 0 +0 0 0 +1 1 1 +2 2 2 +3 3 3 +4 4 4 +5 5 5 +6 6 6 +7 7 7 +8 8 8 +9 9 9 +10 10 10 +11 11 11 +12 12 12 +13 13 13 +14 14 14 +15 15 15 +16 16 16 +17 17 17 +18 18 18 +19 19 19 +20 20 20 +21 21 21 +22 22 22 +23 23 23 +24 24 24 +25 25 25 +26 26 26 +27 27 27 +28 28 28 +29 29 29 +30 30 30 +31 31 31 +32 32 32 +33 33 33 +34 34 34 +35 35 35 +36 36 36 +37 37 37 +38 38 38 +39 39 39 +40 40 40 +41 41 41 +42 42 42 +43 43 43 +44 44 44 +45 45 45 +46 46 46 +47 47 47 +48 48 48 +49 49 49 +50 50 50 +51 51 51 +52 52 52 +53 53 53 +54 54 54 +55 55 55 +56 56 56 +57 57 57 +58 58 58 +59 59 59 +60 60 60 +61 61 61 +62 62 62 +63 63 63 +64 64 64 +65 65 65 +66 66 66 +67 67 67 +68 68 68 +69 69 69 +70 70 70 +71 71 71 +72 72 72 +73 73 73 +74 74 74 +75 75 75 +76 76 76 +77 77 77 +78 78 78 +79 79 79 +80 80 80 +81 81 81 +82 82 82 +83 83 83 +84 84 84 +85 85 85 +86 86 86 +87 87 87 +88 88 88 +89 89 89 +90 90 90 +91 91 91 +92 92 92 +93 93 93 +94 94 94 +95 95 95 +96 96 96 +97 97 97 +98 98 98 +99 99 99 +100 100 100 +101 101 101 +102 102 102 +103 103 103 +104 104 104 +105 105 105 +106 106 106 +107 107 107 +108 108 108 +109 109 109 +110 110 110 +111 111 111 +112 112 112 +113 113 113 +114 114 114 +115 115 115 +116 116 116 +117 117 117 +118 118 118 +119 119 119 +120 120 120 +121 121 121 +122 122 122 +123 123 123 +124 124 124 +125 125 125 +126 126 126 +127 127 127 +128 128 128 +129 129 129 +130 130 130 +131 131 131 +132 132 132 +133 133 133 +134 134 134 +135 135 135 +136 136 136 +137 137 137 +138 138 138 +139 139 139 +140 140 140 +141 141 141 +142 142 142 +143 143 143 +144 144 144 +145 145 145 +146 146 146 +147 147 147 +148 148 148 +149 149 149 +150 150 150 +151 151 151 +152 152 152 +153 153 153 +154 154 154 +155 155 155 +156 156 156 +157 157 157 +158 158 158 +159 159 159 +160 160 160 +161 161 161 +162 162 162 +163 163 163 +164 164 164 +165 165 165 +166 166 166 +167 167 167 +168 168 168 +169 169 169 +170 170 170 +171 171 171 +172 172 172 +173 173 173 +174 174 174 +175 175 175 +176 176 176 +177 177 177 +178 178 178 +179 179 179 +180 180 180 +181 181 181 +182 182 182 +183 183 183 +184 184 184 +185 185 185 +186 186 186 +187 187 187 +188 188 188 +189 189 189 +190 190 190 +191 191 191 +192 192 192 +193 193 193 +194 194 194 +195 195 195 +196 196 196 +197 197 197 +198 198 198 +199 199 199 +200 200 200 +201 201 201 +202 202 202 +203 203 203 +204 204 204 +205 205 205 +206 206 206 +207 207 207 +208 208 208 +209 209 209 +210 210 210 +211 211 211 +212 212 212 +213 213 213 +214 214 214 +215 215 215 +216 216 216 +217 217 217 +218 218 218 +219 219 219 +220 220 220 +221 221 221 +222 222 222 +223 223 223 +224 224 224 +225 225 225 +226 226 226 +227 227 227 +228 228 228 +229 229 229 +230 230 230 +231 231 231 +232 232 232 +233 233 233 +234 234 234 +235 235 235 +236 236 236 +237 237 237 +238 238 238 +239 239 239 +240 240 240 +241 241 241 +242 242 242 +243 243 243 +244 244 244 +245 245 245 +246 246 246 +247 247 247 +248 248 248 +249 249 249 +250 250 250 +251 251 251 +252 252 252 +253 253 253 +254 254 254 +255 255 255 +256 256 256 +257 257 257 +258 258 258 +259 259 259 +260 260 260 +261 261 261 +262 262 262 +263 263 263 +264 264 264 +265 265 265 +266 266 266 +267 267 267 +268 268 268 +269 269 269 +270 270 270 +271 271 271 +272 272 272 +273 273 273 +274 274 274 +275 275 275 +276 276 276 +277 277 277 +278 278 278 +279 279 279 +280 280 280 +281 281 281 +282 282 282 +283 283 283 +284 284 284 +285 285 285 +286 286 286 +287 287 287 +288 288 288 +289 289 289 +290 290 290 +291 291 291 +292 292 292 +293 293 293 +294 294 294 +295 295 295 +296 296 296 +297 297 297 +298 298 298 +299 299 299 +300 300 300 +301 301 301 +302 302 302 +303 303 303 +304 304 304 +305 305 305 +306 306 306 +307 307 307 +308 308 308 +309 309 309 +310 310 310 +311 311 311 +312 312 312 +313 313 313 +314 314 314 +315 315 315 +316 316 316 +317 317 317 +318 318 318 +319 319 319 +320 320 320 +321 321 321 +322 322 322 +323 323 323 +324 324 324 +325 325 325 +326 326 326 +327 327 327 +328 328 328 +329 329 329 +330 330 330 +331 331 331 +332 332 332 +333 333 333 +334 334 334 +335 335 335 +336 336 336 +337 337 337 +338 338 338 +339 339 339 +340 340 340 +341 341 341 +342 342 342 +343 343 343 +344 344 344 +345 345 345 +346 346 346 +347 347 347 +348 348 348 +349 349 349 +350 350 350 +351 351 351 +352 352 352 +353 353 353 +354 354 354 +355 355 355 +356 356 356 +357 357 357 +358 358 358 +359 359 359 +360 360 360 +361 361 361 +362 362 362 +363 363 363 +364 364 364 +365 365 365 +366 366 366 +367 367 367 +368 368 368 +369 369 369 +370 370 370 +371 371 371 +372 372 372 +373 373 373 +374 374 374 +375 375 375 +376 376 376 +377 377 377 +378 378 378 +379 379 379 +380 380 380 +381 381 381 +382 382 382 +383 383 383 +384 384 384 +385 385 385 +386 386 386 +387 387 387 +388 388 388 +389 389 389 +390 390 390 +391 391 391 +392 392 392 +393 393 393 +394 394 394 +395 395 395 +396 396 396 +397 397 397 +398 398 398 +399 399 399 +400 400 400 +401 401 401 +402 402 402 +403 403 403 +404 404 404 +405 405 405 +406 406 406 +407 407 407 +408 408 408 +409 409 409 +410 410 410 +411 411 411 +412 412 412 +413 413 413 +414 414 414 +415 415 415 +416 416 416 +417 417 417 +418 418 418 +419 419 419 +420 420 420 +421 421 421 +422 422 422 +423 423 423 +424 424 424 +425 425 425 +426 426 426 +427 427 427 +428 428 428 +429 429 429 +430 430 430 +431 431 431 +432 432 432 +433 433 433 +434 434 434 +435 435 435 +436 436 436 +437 437 437 +438 438 438 +439 439 439 +440 440 440 +441 441 441 +442 442 442 +443 443 443 +444 444 444 +445 445 445 +446 446 446 +447 447 447 +448 448 448 +449 449 449 +450 450 450 +451 451 451 +452 452 452 +453 453 453 +454 454 454 +455 455 455 +456 456 456 +457 457 457 +458 458 458 +459 459 459 +460 460 460 +461 461 461 +462 462 462 +463 463 463 +464 464 464 +465 465 465 +466 466 466 +467 467 467 +468 468 468 +469 469 469 +470 470 470 +471 471 471 +472 472 472 +473 473 473 +474 474 474 +475 475 475 +476 476 476 +477 477 477 +478 478 478 +479 479 479 +480 480 480 +481 481 481 +482 482 482 +483 483 483 +484 484 484 +485 485 485 +486 486 486 +487 487 487 +488 488 488 +489 489 489 +490 490 490 +491 491 491 +492 492 492 +493 493 493 +494 494 494 +495 495 495 +496 496 496 +497 497 497 +498 498 498 +499 499 499 +500 500 500 +501 501 501 +502 502 502 +503 503 503 +504 504 504 +505 505 505 +506 506 506 +507 507 507 +508 508 508 +509 509 509 +510 510 510 +511 511 511 +512 512 512 +513 513 513 +514 514 514 +515 515 515 +516 516 516 +517 517 517 +518 518 518 +519 519 519 +520 520 520 +521 521 521 +522 522 522 +523 523 523 +524 524 524 +525 525 525 +526 526 526 +527 527 527 +528 528 528 +529 529 529 +530 530 530 +531 531 531 +532 532 532 +533 533 533 +534 534 534 +535 535 535 +536 536 536 +537 537 537 +538 538 538 +539 539 539 +540 540 540 +541 541 541 +542 542 542 +543 543 543 +544 544 544 +545 545 545 +546 546 546 +547 547 547 +548 548 548 +549 549 549 +550 550 550 +551 551 551 +552 552 552 +553 553 553 +554 554 554 +555 555 555 +556 556 556 +557 557 557 +558 558 558 +559 559 559 +560 560 560 +561 561 561 +562 562 562 +563 563 563 +564 564 564 +565 565 565 +566 566 566 +567 567 567 +568 568 568 +569 569 569 +570 570 570 +571 571 571 +572 572 572 +573 573 573 +574 574 574 +575 575 575 +576 576 576 +577 577 577 +578 578 578 +579 579 579 +580 580 580 +581 581 581 +582 582 582 +583 583 583 +584 584 584 +585 585 585 +586 586 586 +587 587 587 +588 588 588 +589 589 589 +590 590 590 +591 591 591 +592 592 592 +593 593 593 +594 594 594 +595 595 595 +596 596 596 +597 597 597 +598 598 598 +599 599 599 +600 600 600 +601 601 601 +602 602 602 +603 603 603 +604 604 604 +605 605 605 +606 606 606 +607 607 607 +608 608 608 +609 609 609 +610 610 610 +611 611 611 +612 612 612 +613 613 613 +614 614 614 +615 615 615 +616 616 616 +617 617 617 +618 618 618 +619 619 619 +620 620 620 +621 621 621 +622 622 622 +623 623 623 +624 624 624 +625 625 625 +626 626 626 +627 627 627 +628 628 628 +629 629 629 +630 630 630 +631 631 631 +632 632 632 +633 633 633 +634 634 634 +635 635 635 +636 636 636 +637 637 637 +638 638 638 +639 639 639 +640 640 640 +641 641 641 +642 642 642 +643 643 643 +644 644 644 +645 645 645 +646 646 646 +647 647 647 +648 648 648 +649 649 649 +650 650 650 +651 651 651 +652 652 652 +653 653 653 +654 654 654 +655 655 655 +656 656 656 +657 657 657 +658 658 658 +659 659 659 +660 660 660 +661 661 661 +662 662 662 +663 663 663 +664 664 664 +665 665 665 +666 666 666 +667 667 667 +668 668 668 +669 669 669 +670 670 670 +671 671 671 +672 672 672 +673 673 673 +674 674 674 +675 675 675 +676 676 676 +677 677 677 +678 678 678 +679 679 679 +680 680 680 +681 681 681 +682 682 682 +683 683 683 +684 684 684 +685 685 685 +686 686 686 +687 687 687 +688 688 688 +689 689 689 +690 690 690 +691 691 691 +692 692 692 +693 693 693 +694 694 694 +695 695 695 +696 696 696 +697 697 697 +698 698 698 +699 699 699 +700 700 700 +701 701 701 +702 702 702 +703 703 703 +704 704 704 +705 705 705 +706 706 706 +707 707 707 +708 708 708 +709 709 709 +710 710 710 +711 711 711 +712 712 712 +713 713 713 +714 714 714 +715 715 715 +716 716 716 +717 717 717 +718 718 718 +719 719 719 +720 720 720 +721 721 721 +722 722 722 +723 723 723 +724 724 724 +725 725 725 +726 726 726 +727 727 727 +728 728 728 +729 729 729 +730 730 730 +731 731 731 +732 732 732 +733 733 733 +734 734 734 +735 735 735 +736 736 736 +737 737 737 +738 738 738 +739 739 739 +740 740 740 +741 741 741 +742 742 742 +743 743 743 +744 744 744 +745 745 745 +746 746 746 +747 747 747 +748 748 748 +749 749 749 +750 750 750 +751 751 751 +752 752 752 +753 753 753 +754 754 754 +755 755 755 +756 756 756 +757 757 757 +758 758 758 +759 759 759 +760 760 760 +761 761 761 +762 762 762 +763 763 763 +764 764 764 +765 765 765 +766 766 766 +767 767 767 +768 768 768 +769 769 769 +770 770 770 +771 771 771 +772 772 772 +773 773 773 +774 774 774 +775 775 775 +776 776 776 +777 777 777 +778 778 778 +779 779 779 +780 780 780 +781 781 781 +782 782 782 +783 783 783 +784 784 784 +785 785 785 +786 786 786 +787 787 787 +788 788 788 +789 789 789 +790 790 790 +791 791 791 +792 792 792 +793 793 793 +794 794 794 +795 795 795 +796 796 796 +797 797 797 +798 798 798 +799 799 799 +800 800 800 +801 801 801 +802 802 802 +803 803 803 +804 804 804 +805 805 805 +806 806 806 +807 807 807 +808 808 808 +809 809 809 +810 810 810 +811 811 811 +812 812 812 +813 813 813 +814 814 814 +815 815 815 +816 816 816 +817 817 817 +818 818 818 +819 819 819 +820 820 820 +821 821 821 +822 822 822 +823 823 823 +824 824 824 +825 825 825 +826 826 826 +827 827 827 +828 828 828 +829 829 829 +830 830 830 +831 831 831 +832 832 832 +833 833 833 +834 834 834 +835 835 835 +836 836 836 +837 837 837 +838 838 838 +839 839 839 +840 840 840 +841 841 841 +842 842 842 +843 843 843 +844 844 844 +845 845 845 +846 846 846 +847 847 847 +848 848 848 +849 849 849 +850 850 850 +851 851 851 +852 852 852 +853 853 853 +854 854 854 +855 855 855 +856 856 856 +857 857 857 +858 858 858 +859 859 859 +860 860 860 +861 861 861 +862 862 862 +863 863 863 +864 864 864 +865 865 865 +866 866 866 +867 867 867 +868 868 868 +869 869 869 +870 870 870 +871 871 871 +872 872 872 +873 873 873 +874 874 874 +875 875 875 +876 876 876 +877 877 877 +878 878 878 +879 879 879 +880 880 880 +881 881 881 +882 882 882 +883 883 883 +884 884 884 +885 885 885 +886 886 886 +887 887 887 +888 888 888 +889 889 889 +890 890 890 +891 891 891 +892 892 892 +893 893 893 +894 894 894 +895 895 895 +896 896 896 +897 897 897 +898 898 898 +899 899 899 +900 900 900 +901 901 901 +902 902 902 +903 903 903 +904 904 904 +905 905 905 +906 906 906 +907 907 907 +908 908 908 +909 909 909 +910 910 910 +911 911 911 +912 912 912 +913 913 913 +914 914 914 +915 915 915 +916 916 916 +917 917 917 +918 918 918 +919 919 919 +920 920 920 +921 921 921 +922 922 922 +923 923 923 +924 924 924 +925 925 925 +926 926 926 +927 927 927 +928 928 928 +929 929 929 +930 930 930 +931 931 931 +932 932 932 +933 933 933 +934 934 934 +935 935 935 +936 936 936 +937 937 937 +938 938 938 +939 939 939 +940 940 940 +941 941 941 +942 942 942 +943 943 943 +944 944 944 +945 945 945 +946 946 946 +947 947 947 +948 948 948 +949 949 949 +950 950 950 +951 951 951 +952 952 952 +953 953 953 +954 954 954 +955 955 955 +956 956 956 +957 957 957 +958 958 958 +959 959 959 +960 960 960 +961 961 961 +962 962 962 +963 963 963 +964 964 964 +965 965 965 +966 966 966 +967 967 967 +968 968 968 +969 969 969 +970 970 970 +971 971 971 +972 972 972 +973 973 973 +974 974 974 +975 975 975 +976 976 976 +977 977 977 +978 978 978 +979 979 979 +980 980 980 +981 981 981 +982 982 982 +983 983 983 +984 984 984 +985 985 985 +986 986 986 +987 987 987 +988 988 988 +989 989 989 +990 990 990 +991 991 991 +992 992 992 +993 993 993 +994 994 994 +995 995 995 +996 996 996 +997 997 997 +998 998 998 +999 999 999 +0-542 +0-111 +1-971 +1-79 +2-818 +2-738 +2-291 +3-707 +4-532 +5-58 +6-492 +6-414 +6-748 +7-870 +8-440 +9-970 +9-381 +10-284 +11-588 +11-878 +11-416 +12-440 +12-179 +13-457 +14-346 +15-663 +15-784 +15-306 +16-699 +17-592 +18-508 +18-432 +19-639 +20-800 +21-835 +21-712 +22-34 +23-83 +24-540 +25-9 +26-419 +27-962 +27-116 +27-845 +28-206 +29-739 +30-681 +31-186 +32-260 +32-310 +32-501 +32-787 +32-852 +33-4 +33-655 +34-63 +34-806 +34-905 +35-228 +36-206 +36-632 +37-698 +38-778 +39-155 +39-690 +39-660 +40-605 +41-829 +41-981 +41-437 +41-33 +41-81 +42-356 +43-367 +44-457 +45-243 +46-740 +46-254 +46-196 +47-754 +48-363 +49-61 +50-634 +51-550 +51-917 +52-316 +53-750 +54-325 +55-533 +55-603 +56-939 +57-412 +57-293 +57-554 +57-70 +57-2 +57-527 +57-433 +57-299 +57-61 +57-162 +57-726 +57-413 +58-27 +58-770 +59-97 +59-226 +60-609 +61-52 +62-421 +62-198 +62-368 +62-177 +62-716 +63-179 +63-678 +64-503 +64-691 +65-163 +66-9 +66-69 +66-455 +66-25 +66-785 +66-958 +66-977 +66-413 +66-136 +67-770 +67-275 +67-41 +67-608 +68-116 +68-643 +69-20 +69-866 +70-723 +70-63 +71-906 +72-113 +73-390 +73-686 +74-772 +74-909 +74-800 +74-996 +74-191 +74-698 +74-519 +74-786 +74-713 +74-781 +75-37 +76-635 +77-728 +77-494 +77-55 +77-268 +78-231 +78-895 +78-844 +78-842 +78-154 +79-502 +79-252 +79-212 +80-802 +80-552 +81-228 +82-240 +82-103 +83-567 +83-954 +83-294 +83-750 +83-814 +83-661 +83-986 +84-323 +85-504 +85-737 +86-535 +87-441 +88-948 +89-716 +90-55 +91-487 +92-121 +93-611 +93-949 +93-2 +93-787 +93-171 +93-424 +94-577 +95-149 +95-542 +96-707 +96-434 +97-810 +97-774 +98-996 +98-415 +98-172 +99-897 +99-713 +99-737 +100-743 +101-283 +101-273 +102-158 +102-842 +103-209 +103-740 +103-113 +103-114 +103-721 +104-920 +104-693 +104-309 +104-746 +105-901 +106-205 +107-400 +108-126 +109-741 +110-539 +110-980 +111-501 +112-923 +112-743 +112-944 +113-350 +113-491 +114-226 +115-176 +115-769 +115-295 +116-7 +117-701 +117-37 +117-595 +118-795 +119-61 +120-692 +121-332 +121-407 +121-67 +122-286 +122-564 +123-907 +123-706 +124-67 +124-928 +125-970 +126-940 +126-969 +126-934 +126-761 +126-198 +126-819 +127-879 +127-837 +128-496 +128-303 +129-377 +129-854 +130-456 +130-490 +130-393 +131-800 +132-949 +132-582 +132-364 +132-852 +133-794 +134-792 +135-937 +136-191 +136-769 +136-186 +136-471 +137-719 +137-111 +137-858 +137-86 +137-584 +138-931 +139-260 +140-387 +140-293 +140-808 +141-108 +142-466 +143-478 +143-317 +143-152 +144-463 +144-159 +144-247 +144-721 +145-233 +145-99 +146-238 +146-358 +146-926 +146-934 +147-344 +148-242 +148-66 +149-45 +150-34 +151-498 +152-477 +152-404 +153-791 +154-163 +154-144 +154-757 +154-974 +154-406 +155-580 +156-94 +156-838 +157-405 +158-201 +159-917 +159-238 +159-631 +159-498 +160-936 +160-683 +160-313 +161-14 +162-228 +163-832 +163-466 +163-117 +164-303 +165-837 +165-465 +166-360 +167-824 +167-749 +167-803 +168-556 +168-521 +169-211 +170-15 +171-280 +171-580 +171-665 +171-882 +172-158 +173-980 +173-150 +174-29 +174-10 +174-199 +175-232 +175-314 +176-163 +177-380 +177-764 +178-867 +178-616 +179-939 +180-691 +180-633 +181-763 +181-117 +181-266 +181-604 +182-103 +182-439 +183-44 +183-451 +184-503 +185-513 +186-231 +187-459 +188-223 +189-685 +190-454 +190-387 +190-959 +191-791 +192-727 +193-94 +194-828 +194-64 +195-462 +195-410 +195-363 +195-972 +196-133 +196-182 +196-314 +196-365 +196-503 +197-413 +198-635 +198-425 +199-357 +200-384 +201-996 +201-95 +201-307 +201-15 +201-969 +201-85 +202-690 +202-253 +203-33 +203-20 +204-771 +205-900 +205-474 +206-634 +207-73 +208-671 +208-230 +208-488 +209-536 +210-948 +211-885 +212-766 +212-654 +213-181 +213-512 +213-447 +214-553 +215-473 +215-946 +216-115 +216-985 +217-755 +217-371 +217-897 +217-304 +218-722 +218-721 +218-505 +218-273 +219-145 +219-868 +220-397 +221-883 +221-734 +222-413 +223-417 +224-985 +225-382 +225-528 +225-673 +226-789 +226-702 +226-790 +227-124 +228-286 +229-684 +229-540 +230-760 +231-822 +231-335 +232-201 +232-284 +232-10 +232-594 +232-512 +232-974 +233-502 +234-991 +235-806 +235-587 +235-98 +235-637 +235-569 +236-605 +237-686 +238-47 +238-835 +239-918 +239-599 +239-297 +239-562 +239-742 +240-211 +240-452 +240-846 +241-853 +241-75 +242-906 +242-838 +243-78 +243-454 +244-911 +245-322 +246-671 +246-463 +247-989 +247-654 +248-203 +249-74 +249-752 +250-443 +250-485 +251-279 +252-205 +253-632 +254-669 +254-641 +254-484 +255-872 +255-250 +256-539 +257-754 +258-633 +259-302 +260-29 +261-501 +261-450 +261-892 +262-168 +262-15 +262-295 +262-665 +263-862 +264-627 +265-798 +266-602 +266-479 +267-105 +267-434 +267-762 +268-846 +269-989 +270-701 +270-334 +270-793 +270-836 +270-52 +271-432 +272-546 +272-871 +273-995 +273-201 +274-165 +275-78 +276-238 +277-390 +277-917 +277-657 +277-147 +277-555 +277-397 +278-6 +278-339 +278-297 +278-917 +278-137 +279-811 +279-850 +279-960 +280-312 +280-531 +280-409 +280-320 +280-757 +281-376 +282-777 +282-58 +283-584 +284-978 +284-471 +285-854 +286-507 +287-97 +288-365 +289-345 +290-975 +291-545 +292-6 +292-331 +292-86 +292-971 +293-850 +293-740 +294-499 +295-480 +295-311 +296-441 +297-211 +297-765 +297-62 +298-965 +298-370 +299-290 +299-165 +300-58 +301-262 +301-7 +302-904 +303-282 +304-951 +304-366 +305-136 +306-637 +307-256 +307-224 +308-804 +309-461 +310-862 +311-928 +312-883 +312-177 +313-735 +313-398 +314-391 +315-415 +316-892 +316-483 +316-482 +317-1 +317-344 +318-486 +318-289 +319-35 +320-376 +321-607 +322-738 +322-804 +323-920 +323-533 +324-592 +324-99 +325-626 +325-137 +325-462 +326-12 +326-170 +326-705 +326-122 +326-72 +326-737 +327-403 +328-587 +329-461 +329-809 +330-247 +330-425 +331-129 +332-331 +332-757 +332-80 +332-536 +333-471 +333-246 +333-773 +333-285 +333-566 +333-62 +333-986 +334-227 +335-742 +336-335 +336-560 +336-700 +337-372 +338-189 +339-181 +339-386 +340-875 +341-256 +341-151 +341-564 +341-248 +341-586 +342-395 +343-450 +344-796 +344-348 +344-739 +344-268 +344-208 +344-894 +344-180 +345-405 +345-727 +346-137 +347-523 +348-408 +348-547 +349-530 +349-484 +350-801 +350-344 +350-191 +351-921 +351-161 +352-328 +352-648 +352-600 +353-952 +353-334 +353-411 +354-413 +354-694 +354-476 +354-74 +354-215 +354-620 +355-721 +355-79 +355-398 +355-154 +356-911 +357-453 +357-191 +358-954 +358-379 +358-110 +359-774 +360-84 +361-775 +361-520 +362-719 +363-230 +364-780 +364-105 +364-217 +365-569 +365-118 +366-203 +366-945 +367-710 +368-745 +368-452 +369-435 +369-391 +369-165 +370-528 +371-705 +371-168 +372-635 +373-12 +373-500 +374-952 +374-967 +375-524 +376-117 +376-749 +377-708 +377-957 +377-567 +378-381 +379-251 +380-382 +380-338 +381-441 +381-861 +382-252 +382-408 +383-318 +383-335 +383-677 +383-954 +383-348 +383-761 +384-642 +385-581 +385-591 +386-368 +386-737 +386-779 +386-230 +386-272 +386-564 +387-288 +388-813 +389-18 +389-852 +389-458 +390-678 +391-157 +391-591 +392-702 +393-127 +394-348 +394-86 +395-660 +396-187 +397-41 +398-609 +398-302 +399-342 +400-186 +400-148 +400-84 +401-727 +401-346 +402-724 +402-85 +403-205 +404-172 +405-995 +406-284 +407-584 +408-745 +408-370 +408-283 +408-86 +408-615 +409-846 +409-472 +410-619 +410-916 +411-777 +412-707 +#412-57 dup +413-640 +414-315 +415-433 +416-901 +417-805 +418-578 +418-458 +419-215 +420-70 +421-994 +421-160 +421-612 +422-385 +423-527 +423-299 +423-387 +424-875 +424-782 +424-679 +425-823 +426-796 +426-975 +427-846 +427-300 +427-210 +427-529 +427-117 +428-104 +429-400 +429-184 +429-833 +429-180 +429-692 +429-593 +430-389 +431-508 +432-812 +433-917 +433-574 +434-299 +434-466 +435-683 +436-690 +437-286 +437-918 +437-726 +437-616 +438-932 +439-390 +440-122 +440-593 +441-890 +442-922 +442-434 +442-35 +442-699 +442-776 +442-41 +443-244 +443-203 +443-923 +444-353 +444-372 +445-881 +446-163 +446-516 +446-902 +447-751 +447-983 +447-308 +447-992 +447-970 +448-427 +448-422 +448-503 +449-60 +450-38 +450-186 +451-94 +452-781 +452-718 +452-194 +452-400 +453-700 +454-163 +454-432 +455-99 +455-874 +455-115 +455-356 +456-131 +456-592 +457-300 +458-547 +458-502 +459-405 +459-619 +459-315 +459-168 +459-320 +459-850 +459-109 +459-806 +459-212 +460-702 +460-610 +461-857 +462-11 +463-299 +464-226 +465-423 +466-359 +467-66 +468-544 +469-791 +469-421 +470-359 +470-60 +470-473 +470-527 +471-489 +472-136 +472-294 +472-365 +472-631 +472-597 +473-683 +473-705 +473-235 +474-196 +474-580 +474-480 +475-464 +476-726 +476-224 +477-831 +477-146 +477-751 +478-862 +479-466 +479-994 +480-478 +481-915 +482-514 +482-926 +482-485 +483-522 +483-520 +483-309 +483-600 +483-356 +484-444 +484-883 +485-419 +485-604 +486-960 +486-424 +#487-91 dup +487-318 +488-784 +488-445 +488-387 +488-449 +489-980 +489-934 +490-775 +491-946 +492-633 +493-193 +493-373 +494-957 +495-1 +495-776 +495-375 +495-140 +495-176 +496-295 +497-529 +498-350 +498-672 +499-678 +499-385 +499-872 +499-136 +499-167 +499-657 +499-503 +499-216 +499-554 +500-374 +501-947 +502-402 +502-491 +502-643 +503-855 +504-886 +504-502 +505-226 +506-559 +506-752 +506-140 +506-129 +506-156 +507-116 +507-366 +508-280 +508-449 +508-679 +509-879 +510-302 +511-769 +511-997 +512-837 +512-358 +512-997 +512-392 +512-159 +513-886 +514-166 +515-49 +515-245 +515-204 +516-668 +517-540 +517-701 +518-464 +518-409 +519-400 +520-428 +521-65 +521-297 +521-799 +522-879 +523-690 +523-629 +523-751 +523-702 +524-332 +525-626 +526-704 +527-180 +527-81 +527-383 +528-829 +528-664 +529-604 +529-304 +529-589 +530-747 +531-974 +531-337 +532-376 +532-492 +533-946 +534-701 +535-91 +536-162 +536-514 +537-419 +537-857 +538-609 +538-960 +539-848 +540-94 +541-136 +542-895 +542-948 +542-594 +543-835 +543-174 +543-710 +544-835 +545-568 +546-190 +547-910 +548-352 +548-647 +548-209 +549-365 +550-113 +550-601 +550-446 +550-815 +551-998 +552-450 +552-108 +553-57 +553-376 +553-829 +553-770 +553-520 +554-761 +554-479 +554-142 +554-876 +554-34 +555-999 +556-314 +557-862 +558-994 +558-14 +558-845 +559-516 +560-386 +561-585 +561-439 +561-19 +562-951 +562-715 +562-33 +562-471 +563-122 +564-276 +565-728 +565-151 +566-496 +566-185 +566-856 +566-733 +566-993 +566-135 +567-765 +567-840 +568-502 +568-511 +568-531 +568-131 +568-93 +568-819 +569-47 +569-151 +570-850 +570-123 +571-997 +571-408 +571-360 +572-839 +573-975 +574-107 +575-829 +575-337 +576-628 +576-824 +577-784 +578-230 +578-371 +578-463 +578-56 +579-173 +579-724 +579-196 +579-296 +580-712 +580-815 +580-681 +580-371 +580-570 +581-595 +582-986 +583-36 +584-934 +585-879 +586-784 +587-570 +587-98 +587-532 +587-371 +587-254 +588-392 +589-684 +589-87 +589-578 +589-948 +589-515 +590-418 +590-80 +591-774 +592-225 +592-440 +592-685 +593-423 +594-125 +594-36 +594-684 +595-207 +596-778 +596-708 +596-60 +597-95 +597-809 +597-19 +598-946 +599-60 +600-97 +600-481 +600-567 +600-16 +600-450 +600-615 +601-401 +602-331 +602-87 +602-304 +602-390 +603-835 +604-841 +604-698 +604-717 +605-940 +605-102 +605-257 +606-316 +606-861 +607-384 +608-175 +608-986 +609-638 +609-542 +609-278 +609-193 +610-921 +610-981 +611-170 +611-10 +612-328 +613-492 +614-954 +615-839 +616-924 +617-771 +617-227 +618-204 +619-993 +619-510 +620-362 +621-161 +622-940 +622-543 +623-678 +623-882 +623-144 +623-802 +623-701 +623-829 +623-895 +624-735 +624-759 +625-151 +625-695 +626-559 +627-762 +627-794 +628-542 +629-141 +630-335 +630-419 +631-520 +631-598 +631-104 +632-292 +632-203 +632-528 +632-596 +632-119 +632-909 +633-556 +633-940 +633-767 +633-358 +633-393 +634-597 +635-898 +636-817 +636-718 +637-403 +638-93 +638-564 +638-14 +638-313 +639-290 +639-74 +640-115 +640-839 +640-801 +641-913 +641-871 +641-97 +641-210 +641-564 +642-916 +642-30 +643-596 +644-978 +645-724 +645-432 +646-717 +647-927 +647-631 +647-462 +648-61 +649-165 +649-368 +649-260 +650-142 +650-804 +651-238 +652-886 +652-953 +653-409 +654-211 +654-745 +655-251 +656-896 +656-794 +657-953 +658-793 +659-802 +659-534 +659-68 +659-648 +660-844 +661-125 +661-147 +661-326 +661-536 +662-146 +663-447 +664-359 +664-72 +665-229 +665-389 +666-743 +667-182 +667-330 +667-812 +667-540 +667-92 +668-798 +669-583 +670-844 +670-624 +671-833 +671-151 +671-76 +671-756 +672-153 +673-977 +673-730 +673-207 +673-394 +674-421 +675-737 +675-962 +675-590 +675-964 +676-892 +676-60 +677-232 +677-718 +677-342 +678-30 +678-777 +678-886 +679-961 +679-978 +680-441 +681-755 +681-737 +682-697 +682-829 +682-378 +683-966 +684-405 +685-405 +685-631 +685-703 +685-560 +685-638 +685-843 +685-411 +685-806 +685-291 +685-758 +686-287 +687-933 +687-139 +688-555 +688-760 +688-830 +689-922 +690-979 +690-177 +690-556 +691-534 +691-989 +692-19 +693-505 +693-155 +694-0 +695-322 +695-332 +695-371 +695-440 +696-165 +696-694 +696-157 +697-767 +697-923 +697-527 +697-742 +697-610 +698-564 +698-770 +698-453 +698-934 +699-299 +699-372 +700-278 +700-187 +700-84 +700-579 +701-495 +701-656 +701-395 +702-784 +702-691 +703-501 +704-179 +705-276 +705-984 +705-93 +705-233 +706-790 +707-98 +707-319 +708-493 +709-718 +709-796 +709-142 +710-881 +711-790 +711-11 +712-101 +713-577 +713-772 +713-821 +713-488 +714-593 +715-769 +716-891 +717-545 +718-737 +718-918 +718-161 +719-594 +720-950 +720-739 +720-964 +720-672 +721-973 +721-192 +722-193 +722-210 +722-276 +723-100 +723-745 +723-707 +723-355 +723-747 +724-283 +725-654 +726-656 +726-743 +726-466 +726-396 +726-503 +727-273 +727-685 +727-233 +727-818 +728-101 +728-472 +729-104 +730-280 +730-618 +731-505 +732-989 +732-854 +733-679 +733-48 +734-937 +734-164 +735-200 +736-909 +737-332 +737-885 +737-287 +738-473 +739-605 +740-500 +741-776 +742-103 +742-900 +742-559 +742-811 +743-677 +743-337 +744-9 +745-456 +745-331 +745-749 +746-219 +746-122 +747-798 +748-447 +748-272 +748-742 +748-448 +748-898 +748-766 +748-380 +749-841 +749-461 +750-383 +750-833 +750-361 +751-27 +752-899 +752-501 +752-441 +753-552 +754-794 +755-726 +756-101 +756-999 +756-211 +756-888 +756-525 +757-370 +758-411 +759-826 +759-366 +759-496 +759-408 +759-156 +759-969 +759-28 +760-68 +761-188 +762-317 +763-161 +763-822 +764-531 +764-97 +765-444 +766-944 +767-958 +767-953 +768-458 +769-486 +770-419 +770-688 +770-798 +770-413 +771-299 +772-658 +773-557 +774-199 +774-598 +775-76 +775-617 +776-804 +776-892 +776-357 +776-680 +777-153 +777-346 +777-394 +778-103 +778-479 +779-943 +780-323 +781-655 +781-93 +781-538 +781-322 +782-349 +782-804 +782-427 +782-610 +782-251 +783-944 +784-942 +785-567 +785-564 +786-246 +786-722 +786-841 +787-835 +788-56 +788-326 +788-886 +788-315 +788-762 +788-725 +788-864 +789-547 +789-780 +790-536 +791-869 +791-568 +792-593 +793-628 +793-902 +794-972 +794-585 +795-603 +796-898 +796-889 +797-855 +798-609 +799-258 +799-420 +799-335 +799-739 +800-65 +800-345 +800-104 +801-969 +801-689 +801-786 +802-472 +803-530 +803-958 +803-510 +804-987 +804-617 +804-400 +805-227 +805-690 +805-191 +805-14 +805-420 +806-108 +807-931 +807-907 +808-788 +808-160 +808-108 +809-789 +809-709 +809-782 +809-962 +810-358 +811-999 +812-936 +812-445 +812-820 +812-195 +812-14 +813-249 +813-139 +814-21 +814-536 +815-708 +816-720 +816-815 +816-60 +816-444 +817-754 +818-408 +818-420 +819-101 +819-345 +820-416 +820-13 +821-619 +822-688 +822-17 +822-538 +822-52 +822-886 +823-61 +824-898 +825-843 +825-552 +826-496 +827-410 +827-127 +828-107 +829-190 +830-989 +830-562 +831-574 +831-721 +832-12 +833-742 +833-111 +834-657 +834-576 +834-486 +834-557 +834-331 +834-92 +835-870 +836-157 +837-577 +837-186 +838-255 +839-309 +839-835 +840-917 +841-832 +841-756 +842-371 +843-569 +843-977 +843-249 +844-998 +844-314 +844-729 +845-258 +846-676 +846-726 +847-421 +847-954 +847-420 +848-845 +848-810 +848-63 +849-771 +849-978 +849-904 +849-565 +850-441 +851-404 +852-128 +853-946 +853-129 +854-18 +855-159 +855-498 +856-26 +857-449 +857-660 +858-896 +858-333 +859-866 +859-241 +859-97 +860-806 +860-398 +861-331 +862-178 +863-597 +864-385 +864-172 +865-772 +866-711 +866-275 +867-654 +867-73 +867-246 +867-850 +868-319 +869-247 +869-914 +869-327 +870-128 +870-860 +870-380 +871-604 +872-441 +872-550 +873-86 +874-732 +875-343 +876-436 +876-775 +876-430 +876-222 +877-76 +878-473 +879-881 +880-109 +881-319 +882-62 +883-973 +884-138 +884-730 +884-778 +885-893 +886-191 +886-234 +887-461 +888-478 +888-678 +888-514 +888-619 +889-165 +889-544 +889-114 +890-877 +891-874 +892-132 +893-346 +894-733 +895-615 +895-217 +896-670 +897-227 +897-570 +898-923 +899-260 +900-378 +901-613 +901-620 +901-526 +902-241 +902-675 +903-603 +904-468 +904-820 +904-808 +904-934 +905-491 +905-65 +905-961 +906-638 +906-95 +906-611 +906-958 +906-410 +906-392 +906-186 +907-422 +907-130 +908-284 +909-326 +910-179 +910-637 +911-491 +912-496 +913-181 +914-619 +915-883 +916-720 +917-281 +918-993 +918-705 +918-713 +918-183 +919-98 +919-381 +919-25 +919-614 +919-635 +920-559 +920-508 +920-580 +920-47 +920-743 +921-389 +922-366 +922-113 +923-464 +923-187 +924-691 +925-760 +925-336 +926-129 +926-728 +927-73 +928-956 +929-147 +929-718 +930-678 +931-929 +932-789 +932-582 +933-56 +933-994 +934-734 +934-117 +934-144 +935-240 +935-674 +936-46 +936-921 +937-618 +938-650 +938-367 +938-876 +938-8 +938-288 +938-390 +939-398 +940-179 +941-185 +941-585 +942-443 +942-938 +943-291 +943-788 +944-856 +944-462 +945-368 +945-787 +945-933 +946-880 +947-489 +948-311 +948-86 +949-728 +949-353 +950-674 +950-983 +950-729 +950-898 +950-751 +951-47 +952-210 +953-202 +954-665 +955-672 +955-786 +955-236 +956-469 +957-854 +957-38 +958-431 +959-460 +959-754 +959-65 +959-230 +960-386 +960-232 +960-504 +960-571 +960-313 +960-26 +961-454 +961-453 +961-902 +962-212 +963-545 +964-972 +965-95 +966-939 +967-501 +968-416 +968-820 +968-457 +969-841 +970-371 +971-696 +971-688 +971-198 +972-765 +972-818 +973-563 +974-609 +975-587 +975-889 +975-633 +976-855 +977-113 +977-30 +977-185 +978-102 +978-362 +978-942 +979-667 +980-794 +980-987 +980-195 +981-658 +982-282 +983-243 +983-340 +984-164 +984-140 +984-265 +984-789 +984-86 +984-59 +984-939 +984-406 +985-511 +985-208 +985-786 +986-230 +987-843 +988-340 +988-786 +989-213 +990-882 +991-642 +992-713 +992-568 +993-671 +993-497 +993-982 +993-203 +993-881 +994-470 +994-167 +994-900 +995-147 +995-600 +995-623 +996-375 +996-629 +997-395 +997-674 +998-429 +999-462 +start-99 +start-806 +start-49 +start-843 +start-960 +end-121 +end-563 +end-437 diff --git a/maps/comments b/maps/comments new file mode 100644 index 0000000..57c77cd --- /dev/null +++ b/maps/comments @@ -0,0 +1,11 @@ +3 +#you +##start +start 0 0 +#lost +##end +end 1 1 +#the +#game +start-end +#!! diff --git a/maps/duplicatepipe b/maps/duplicatepipe new file mode 100644 index 0000000..11ee158 --- /dev/null +++ b/maps/duplicatepipe @@ -0,0 +1,7 @@ +3 +##start +start 0 0 +##end +end 0 0 +start-end +end-start diff --git a/maps/duplicatepipe1 b/maps/duplicatepipe1 new file mode 100644 index 0000000..4765c02 --- /dev/null +++ b/maps/duplicatepipe1 @@ -0,0 +1,7 @@ +3 +##start +start 0 0 +##end +end 0 0 +start-end +start-end diff --git a/maps/empty b/maps/empty new file mode 100644 index 0000000..e69de29 diff --git a/maps/illegalname b/maps/illegalname new file mode 100644 index 0000000..023f65c --- /dev/null +++ b/maps/illegalname @@ -0,0 +1,7 @@ +3 +Lillegalname 2 2 +##start +start 0 0 +##end +end 1 1 +start-end diff --git a/maps/illegalname1 b/maps/illegalname1 new file mode 100644 index 0000000..ea903a3 --- /dev/null +++ b/maps/illegalname1 @@ -0,0 +1,7 @@ +3 +ill-egalname 2 2 +##start +start 0 0 +##end +end 1 1 +start-end diff --git a/maps/in0 b/maps/in0 new file mode 100644 index 0000000..92e3ed5 --- /dev/null +++ b/maps/in0 @@ -0,0 +1,25 @@ +3 +##start +1 23 3 +2 16 7 +#commentaire +3 16 3 +4 16 5 +5 9 3 +6 1 5 +7 4 8 +##end +0 9 5 +0-4 +0-6 +1-3 +4-3 +5-2 +3-5 +#autre commentaire +4-2 +2-1 +7-6 +7-2 +7-4 +6-5 diff --git a/maps/invalidcommand b/maps/invalidcommand new file mode 100644 index 0000000..066ac39 --- /dev/null +++ b/maps/invalidcommand @@ -0,0 +1,8 @@ +3 +##start +start 0 0 +##end +end 1 1 +##invalidcommand +room 2 2 +start-end diff --git a/maps/invalidcommand1 b/maps/invalidcommand1 new file mode 100644 index 0000000..2628560 --- /dev/null +++ b/maps/invalidcommand1 @@ -0,0 +1,6 @@ +3 +start 0 0 +##end +end 1 1 +##start +start-end diff --git a/maps/loop b/maps/loop new file mode 100644 index 0000000..4ad8755 --- /dev/null +++ b/maps/loop @@ -0,0 +1,11 @@ +3 +##start +start 0 0 +##end +end 1 1 +mid0 2 2 +mid1 3 3 +start-mid0 +mid0-mid1 +mid1-start +start-end diff --git a/maps/loop1 b/maps/loop1 new file mode 100644 index 0000000..bc6e3be --- /dev/null +++ b/maps/loop1 @@ -0,0 +1,10 @@ +3 +##start +start 0 0 +##end +end 1 1 +mid0 2 2 +mid1 3 3 +start-mid0 +mid0-mid1 +mid1-start diff --git a/maps/noants b/maps/noants new file mode 100644 index 0000000..9ea9d31 --- /dev/null +++ b/maps/noants @@ -0,0 +1,5 @@ +##start +start 0 0 +##end +end 1 1 +start-end diff --git a/maps/noend b/maps/noend new file mode 100644 index 0000000..a7b1ae3 --- /dev/null +++ b/maps/noend @@ -0,0 +1,5 @@ +3 +##start +start 0 0 +end 1 1 +start-end diff --git a/maps/nopath b/maps/nopath new file mode 100644 index 0000000..f302735 --- /dev/null +++ b/maps/nopath @@ -0,0 +1,5 @@ +3 +##start +start 0 0 +##end +end 1 1 diff --git a/maps/nostart b/maps/nostart new file mode 100644 index 0000000..06234df --- /dev/null +++ b/maps/nostart @@ -0,0 +1,5 @@ +3 +start 0 0 +##end +end 1 1 +start-end diff --git a/maps/overflow b/maps/overflow new file mode 100644 index 0000000..ad21d92 --- /dev/null +++ b/maps/overflow @@ -0,0 +1,6 @@ +3 +##start +start 0 0 +##end +end 999999999999999999999 9999999999999999999999999999 +start-end diff --git a/maps/shortest b/maps/shortest new file mode 100644 index 0000000..7a4b585 --- /dev/null +++ b/maps/shortest @@ -0,0 +1,20 @@ +3 +##start +start 0 0 +##end +end 1 1 +long0 2 2 +long1 3 3 +short 4 4 +longer0 5 5 +longer1 6 6 +longer2 7 7 +start-long0 +long0-long1 +long1-end +start-short +short-end +start-longer0 +longer0-longer1 +longer1-longer2 +longer2-end diff --git a/maps/simple b/maps/simple new file mode 100644 index 0000000..3371c4f --- /dev/null +++ b/maps/simple @@ -0,0 +1,6 @@ +3 +##start +start 0 0 +##end +end 1 1 +start-end diff --git a/maps/simple1 b/maps/simple1 new file mode 100644 index 0000000..01352e5 --- /dev/null +++ b/maps/simple1 @@ -0,0 +1,10 @@ +4 +##start +start 0 0 +##end +end 1 1 +dead0 2 2 +dead1 3 3 +start-dead0 +start-dead1 +start-end diff --git a/maps/simple2 b/maps/simple2 new file mode 100644 index 0000000..a3d3f97 --- /dev/null +++ b/maps/simple2 @@ -0,0 +1,16 @@ +4 +##start +start 0 0 +##end +end 1 1 +dead0 2 2 +dead1 3 3 +mid0 4 4 +mid1 5 5 +mid2 6 6 +start-dead0 +start-mid0 +mid0-dead0 +start-mid1 +mid1-mid2 +mid2-end diff --git a/maps/startisend b/maps/startisend new file mode 100644 index 0000000..0a2a632 --- /dev/null +++ b/maps/startisend @@ -0,0 +1,4 @@ +3 +##start +##end +startend 0 0 diff --git a/maps/subject22.map b/maps/subject22.map new file mode 100644 index 0000000..ea22e19 --- /dev/null +++ b/maps/subject22.map @@ -0,0 +1,13 @@ +3 +1 0 2 +##start +0 2 0 +##end +4 2 6 +2 4 2 +3 4 4 +0-1 +0-2 +2-3 +3-4 +4-1 \ No newline at end of file diff --git a/maps/underflow b/maps/underflow new file mode 100644 index 0000000..cfff1cc --- /dev/null +++ b/maps/underflow @@ -0,0 +1,6 @@ +3 +##start +start 0 0 +##end +end 1 -9999999999999999999999999 +start-end diff --git a/maps/whitespaces b/maps/whitespaces new file mode 100644 index 0000000..2de645f --- /dev/null +++ b/maps/whitespaces @@ -0,0 +1,7 @@ + 3 +# #end +##start + start 0 0 +##end +end 1 1 +start-end diff --git a/srcs/lem_in.c b/srcs/lem_in.c new file mode 100644 index 0000000..ffa7a90 --- /dev/null +++ b/srcs/lem_in.c @@ -0,0 +1,48 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* lem_in.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: mndhlovu +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/03/25 06:31:05 by mndhlovu #+# #+# */ +/* Updated: 2019/03/25 06:31:09 by mndhlovu ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "lem_in.h" + +int lm_error_exit(int flag) +{ + if (flag == 0) + ft_printf("Invalid Map\n"); + if (flag == 1) + ft_printf("Usage ./lem_in < map-file\n"); + if (flag == 2) + ft_printf("Error opening the Map file\n"); + return (1); +} + +int main(int ac, char **av) +{ + t_syntax synt; + t_graph graph; + t_lmdata ldata; + int fd; + + lm_init_data(&synt, &ldata); + if (ac > 1) + { + if ((fd = open (av[1], O_RDONLY)) < -1) + return (lm_error_exit(2)); + if (lm_parser(fd, &synt, &ldata, &graph)) + { + //the parser was successful in extracting data from the map + //here goes the function for making the adjacency list + ft_printf("number of ants %d\n", ldata.nbants); + ft_printf("start flags status %d, location %d \n", synt.s_cmd, synt.s_pos); + ft_printf("end flag status %d, location %d \n", synt.e_cmd, synt.e_pos); + } + } + return (0); +} \ No newline at end of file diff --git a/srcs/lm_graph_utils.c b/srcs/lm_graph_utils.c new file mode 100644 index 0000000..30ef487 --- /dev/null +++ b/srcs/lm_graph_utils.c @@ -0,0 +1,68 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* lm_graph_utils.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: mndhlovu +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/03/29 07:17:06 by mndhlovu #+# #+# */ +/* Updated: 2019/03/29 07:17:26 by mndhlovu ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "lem_in.h" + +t_adjnode *lm_new_node(int dest) +{ + t_adjnode *new; + + if (!(new = (t_adjnode *)malloc(sizeof(t_adjnode)))) + return (NULL); + new->dest = dest; + new->next = NULL; + return (new); +} + +t_graph *lm_creategraph(int v) +{ + t_graph *new_graph; + int index; + + index = -1; + if (!(new_graph = (t_graph *)malloc(sizeof(t_graph)))) + return (NULL); + new_graph->vert = v; + if (!(new_graph->array = (t_adjlist *)malloc(sizeof(t_adjlist) * v))) + return (NULL); + while (++index < v) + new_graph->array[index].head = NULL; + return (new_graph); +} + +void lm_ext_conn(t_graph *graph, t_lmdata *data, + char *raw, t_syntax *synt) +{ + char **tab; + + if (synt->gr_status == 5) + { + graph = lm_creategraph(data->nb_nodes); + synt->gr_status = 1; + } + tab = ft_strsplit(raw, '-'); + if (tab != NULL) + lm_add_edge(graph, lm_find_index(data, tab[0]), lm_find_index(data, tab[1])); +} + +//function to add the edges and create a proper adjacency list +void lm_add_edge(t_graph *graph, int src, int dest) +{ + t_adjnode *newnode; + + newnode = lm_new_node(dest); + newnode->next = graph->array[src].head; + graph->array[src].head = newnode; + newnode = lm_new_node(src); + newnode->next = graph->array[dest].head; + graph->array[dest].head = newnode; +} \ No newline at end of file diff --git a/srcs/lm_mem_utils.c b/srcs/lm_mem_utils.c new file mode 100644 index 0000000..803774e --- /dev/null +++ b/srcs/lm_mem_utils.c @@ -0,0 +1,77 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* lm_mem_utils.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: mndhlovu +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/03/25 06:31:37 by mndhlovu #+# #+# */ +/* Updated: 2019/03/25 06:31:45 by mndhlovu ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "lem_in.h" + +void lm_init_data(t_syntax *synt, t_lmdata *ldata) +{ + synt->s_cmd = 0; + synt->s_pos = 0; + synt->e_cmd = 0; + synt->e_pos = 0; + synt->gr_status = 0; + synt->e_vert = 0; + synt->s_vert = 0; + synt->v_flag = 0; + ldata->nbants = 0; + ldata->nb_nodes = 0; + ldata->nodes_data = NULL; + ldata->nodes = NULL; + ldata->adj = NULL; +} + +void lm_add_vertex(t_lmdata *ldata, char *raw, char flag) +{ + char **tab; + t_node *room; + t_node *tmp; + + if (!(room = (t_node *)malloc(sizeof(t_node)))) + return ; + tab = ft_strsplit(raw, ' '); + if (tab != NULL) + { + room->name = tab[0]; + room->x = ft_atoi(tab[1]); + room->y = ft_atoi(tab[2]); + room->role = flag; + room->ind = ldata->nb_nodes; + room->next = NULL; + if (ldata->nodes_data == NULL) + ldata->nodes_data = room; + else + { + tmp = ldata->nodes_data; + while (tmp->next) + tmp = tmp->next; + tmp->next = room; + } + (ldata->nb_nodes)++; + } +} + +int lm_find_index(t_lmdata *data, char *str) +{ + t_node *nodes; + + nodes = data->nodes_data; + if (nodes != NULL) + { + while (nodes->next) + { + if (ft_strcmp(nodes->name, str)) + return (nodes->ind); + nodes = nodes->next; + } + } + return (-1); +} \ No newline at end of file diff --git a/srcs/lm_parser.c b/srcs/lm_parser.c new file mode 100644 index 0000000..32e3d98 --- /dev/null +++ b/srcs/lm_parser.c @@ -0,0 +1,126 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* lm_parser.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: mndhlovu +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/03/25 06:30:51 by mndhlovu #+# #+# */ +/* Updated: 2019/03/25 06:30:57 by mndhlovu ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "lem_in.h" + +static void lm_locate_cmd(int count, char *raw, t_syntax *synt) +{ + int s_state; + int e_state; + char *tmp; + int index; + + index = 0; + s_state = synt->s_cmd; + e_state = synt->e_cmd; + tmp = ft_strchr(raw, '#'); + if ((!s_state || !e_state) && (tmp != NULL && raw[index + 1] == '#')) + { + if (!s_state) + { + if (ft_strcmp(tmp, "##start")) + { + synt->s_cmd = 1; + synt->e_pos = count; + } + } + if (!e_state) + { + if (ft_strcmp(tmp, "##end")) + { + synt->e_cmd = 1; + synt->s_pos = count; + } + } + } +} + +static void lm_get_vertices(int count, char *raw, t_syntax *synt, + t_lmdata *data, t_graph *graph) +{ + int index; + char *tmp; + char *tmp2; + int value; + + index = 0; + value = 0; + graph = NULL; + if (synt->s_cmd > 0 && (synt->e_pos == count - 1)) + { + synt->s_vert = count; + lm_add_vertex(data, raw, 's'); + } + if (synt->e_cmd > 0 && (synt->s_pos == count - 1)) + { + synt->e_vert = count; + lm_add_vertex(data, raw, 'e'); + } + if (count > 0 && (count != synt->s_vert && count != synt->e_vert) + && (count != synt->s_pos && count != synt->e_pos)) + { + tmp = ft_strchr(raw, '-'); + tmp2 = ft_strchr(raw, '#'); + if (tmp == NULL && tmp2 == NULL) + lm_add_vertex(data, raw, 'v'); + else if (tmp2 == NULL && tmp != NULL) + { + lm_ext_conn(graph, data, raw, synt); + } + } +} + +static void lm_get_ant_num(int count, char *raw, t_lmdata *ldata, t_syntax *synt) +{ + int index; + int value; + + index = 0; + if (count == 0) + { + if (!ft_isdigit(raw[index + 1])) + { + value = raw[index] - '0'; + ldata->nbants = (value > 0) ? value : 0; + synt->nb_state = 1; + } + if (ft_isdigit(raw[index + 1])) + { + ldata->nbants = (ft_atoi(raw) > 0) ? ft_atoi(raw) : 0; + synt->nb_state = 1; + } + } +} + + +int lm_parser(int fd, t_syntax *synt, t_lmdata *ldata, + t_graph *graph) +{ + char *raw; + int ret; + int index; + + index = 0; + ft_printf("debug flags %d \n", index); + while ((ret = get_next_line(fd, &raw))) + { + if (ret == -1) + return (0); + lm_get_ant_num(index, raw, ldata, synt); + lm_locate_cmd(index, raw, synt); + lm_get_vertices(index, raw, synt, ldata, graph); + index++; + } + if (index > 1) + return (1); + return (0); +} \ No newline at end of file