This repository has been archived by the owner on Jul 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
1790 lines (1512 loc) · 63.4 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from multiprocessing import Pool
import copy
import random
print('import done')
def roadmap(call_number, frame_record):
ITEMS = {
1: {"NAME":"Shroom Fry",
"RECIPES":[["Dried Shroom"],
["Mushroom"],
["Poison Shroom"],
["Super Shroom"],
["Volt Shroom"],
#["Dried Shroom","Fire Flower"], #Trivial Improvement Exists
#["Dried Shroom","Volt Shroom"], #Trivial Improvement Exists
#["Mushroom","Dried Shroom"], #Trivial Improvement Exists
#["Mushroom","Turtley Leaf"], #Trivial Improvement Exists
#["Mushroom","Golden Leaf"], #Trivial Improvement Exists
],
},
2: {"NAME":"Shroom Roast",
"RECIPES":[["Slow Shroom"],
["Life Shroom"],
#["Life Shroom","Volt Shroom"], #Trivial Improvement Exists
#["Mushroom","Fire Flower"], #Unnecessary 2 Ingredients
#["Mushroom","Super Shroom"], #Unnecessary 2 Ingredients
#["Mushroom","Volt Shroom"], #Unnecessary 2 Ingredients
#["Super Shroom","Dried Shroom"], #Unnecessary 2 Ingredients
#["Super Shroom","Volt Shroom"], #Unnecessary 2 Ingredients
#["Super Shroom","Turtley Leaf"], #Unnecessary 2 Ingredients
#["Super Shroom","Golden Leaf"], #Unnecessary 2 Ingredients
],
},
3: {"NAME":"Shroom Steak",
"RECIPES":[["Ultra Shroom"],
#["Life Shroom","Dried Shroom"], #Unnecessary 2 Ingredients
#["Life Shroom","Mushroom"], #Unnecessary 2 Ingredients
#["Life Shroom","Super Shroom"], #Unnecessary 2 Ingredients
#["Life Shroom","Ultra Shroom"], #Trivial Improvement Exists
#["Life Shroom","Turtley Leaf"], #Unnecessary 2 Ingredients
#["Life Shroom","Golden Leaf"], #Unnecessary 2 Ingredients
#["Ultra Shroom","Dried Shroom"],#Trivial Improvement Exists
#["Ultra Shroom","Mushroom"], #Trivial Improvement Exists
#["Ultra Shroom","Super Shroom"],#Trivial Improvement Exists
#["Ultra Shroom","Volt Shroom"], #Trivial Improvement Exists
#["Ultra Shroom","Turtley Leaf"],#Trivial Improvement Exists
#["Ultra Shroom","Golden Leaf"], #Trivial Improvement Exists
],
},
4: {"NAME":"Honey Shroom",
"RECIPES":[["Mystery"],
#["Mushroom","Honey Syrup"], #Unnecessary 2 Ingredients
#["Slow Shroom","Honey Syrup"], #Unnecessary 2 Ingredients
#["Volt Shroom","Honey Syrup"], #Unnecessary 2 Ingredients
],
},
5: {"NAME":"Maple Shroom",
"RECIPES":[["Mushroom","Maple Syrup"],
["Volt Shroom","Maple Syrup"]],
},
6: {"NAME":"Jelly Shroom",
"RECIPES":[["Mushroom","Jammin Jelly"],
["Volt Shroom","Jammin Jelly"]],
},
7: {"NAME":"Honey Super",
"RECIPES":[["Life Shroom","Honey Syrup"],
["Super Shroom", "Honey Syrup"]],
},
8: {"NAME":"Maple Super",
"RECIPES":[["Super Shroom","Maple Syrup"]],
},
9: {"NAME":"Jelly Super",
"RECIPES":[["Life Shroom","Jammin Jelly"],
["Super Shroom","Jammin Jelly"]],
},
10: {"NAME":"Honey Ultra",
"RECIPES":[["Ultra Shroom","Honey Syrup"]],
},
11: {"NAME":"Maple Ultra",
"RECIPES":[["Ultra Shroom","Maple Syrup"]],
},
12: {"NAME":"Jelly Ultra",
"RECIPES":[["Ultra Shroom","Jammin Jelly"]],
},
13: {"NAME":"Zess Dinner",
"RECIPES":[["Mystery"],
#["Mushroom","Horsetail"], #Unnecessary 2 Ingredients
#["Super Shroom","Fire Flower"], #Unnecessary 2 Ingredients
#["Super Shroom","Horsetail"], #Unnecessary 2 Ingredients
#["Super Shroom","Gradual Syrup"], #Unnecessary 2 Ingredients
#["Super Shroom","Keel Mango"], #Unnecessary 2 Ingredients
#["Super Shroom","Peachy Peach"], #Unnecessary 2 Ingredients
#["Ultra Shroom","Keel Mango"], #Unnecessary 2 Ingredients
#["Life Shroom","Fire Flower"], #Unnecessary 2 Ingredients
#["Life Shroom","Gradual Syrup"], #Unnecessary 2 Ingredients
#["Life Shroom","Horsetail"], #Unnecessary 2 Ingredients
#["Fresh Pasta","Mystic Egg"], #Unnecessary 2 Ingredients
#["Fresh Pasta","Coconut"], #Unnecessary 2 Ingredients
#["Fresh Pasta","Healthy Salad"], #Unnecessary 2 Ingredients
#["Healthy Salad","Shroom Fry"], #Unnecessary 2 Ingredients
#["Healthy Salad","Koopasta"], #Unnecessary 2 Ingredients
#["Healthy Salad","Spaghetti"], #Unnecessary 2 Ingredients
#["Spicy Pasta","Coconut"], #Unnecessary 2 Ingredients
#["Meteor Meal","Fruit Partaif"] #Unnecessary 2 Ingredients
],
},
14: {"NAME":"Zess Special",
"RECIPES":[
#["Whacka Bump"], #Whacka Bump is never used in evaluation
#["Fresh Pasta","Dried Shroom"], #Fresh Pasta is never used in evaluation
#["Fresh Pasta","Life Shroom"], #Fresh Pasta is never used in evaluation
#["Fresh Pasta","Mushroom"], #Fresh Pasta is never used in evaluation
#["Fresh Pasta","Super Shroom"], #Fresh Pasta is never used in evaluation
["Ultra Shroom","Fire Flower"],
["Ultra Shroom","Peachy Peach"],
#["Ultra Shroom","Gradual Syrup"], #Gradual Syrup is never used in evaluation
#["Ultra Shroom","Horsetail"], #Horsetail is never used in evaluation
["Healthy Salad","Ink Pasta"],
["Healthy Salad","Shroom Roast"],
["Healthy Salad","Spicy Pasta"]
],
},
15: {"NAME":"Zess Deluxe",
"RECIPES":[["Shroom Steak","Healthy Salad"],
#["Ultra Shroom","Fresh Pasta"], #Fresh Pasta is never used in evaluation
#["Whacka Bump","Golden Leaf"], #Whacka Bump is never used in evaluation
],
},
16: {"NAME":"Spaghetti",
"RECIPES":[["Mystery"],
#["Fresh Pasta"], #Fresh Pasta is never used in evaluation
],
},
17: {"NAME":"Koopasta",
"RECIPES":[["Mystery"],
#["Fresh Pasta","Turtley Leaf"], #Fresh Pasta is never used in evaluation
#["Spaghetti","Turtley Leaf"], #Unnecessary 2 Ingredients
]
},
18: {"NAME":"Spicy Pasta",
"RECIPES":[
#["Hot Sauce","Fresh Pasta"], #Fresh Pasta is never used in evaluation
["Hot Sauce","Spaghetti"],
["Hot Sauce","Koopasta"],
],
},
19: {"NAME":"Ink Pasta",
"RECIPES":[
#["Inky Sauce","Fresh Pasta"], #Fresh Pasta is never used in evaluation
["Inky Sauce","Koopasta"],
["Inky Sauce","Spaghetti"],
["Inky Sauce","Spicy Pasta"]],
},
20: {"NAME":"Spicy Soup",
"RECIPES":[["Mystery"],
["Fire Flower"],
#["Horsetail"], #Horsetail is never used in evaluation
["Snow Bunny"],
#["Fire Flower","Hot Sauce"], #Trivial Improvement Exists
#["Fire Flower","Dried Bouquet"], #Trivial Improvement Exists
]
},
21: {"NAME":"Fried Egg",
"RECIPES":[["Mystery"],
["Mystic Egg"],
],
},
22: {"NAME":"Omelette Meal",
"RECIPES":[
#["Mystic Egg","Horsetail"], #Horsetail is never used in evaluation
["Mystic Egg","Mushroom"],
["Mystic Egg","Super Shroom"],
["Mystic Egg","Life Shroom"],
["Mystic Egg","Ultra Shroom"],
],
},
23: {"NAME":"Koopa Bun",
"RECIPES":[["Keel Mango","Turtley Leaf"],
],
},
24: {"NAME":"Healthy Salad",
"RECIPES":[["Turtley Leaf","Golden Leaf"],
#["Turtley Leaf","Horsetail"], #Horsetail is never used in evaluation
],
},
25: {"NAME":"Meteor Meal",
"RECIPES":[["Shroom Fry","Shooting Star"],
["Shroom Roast","Shooting Star"],
["Shroom Steak","Shooting Star"]],
},
26: {"NAME":"Couples Cake",
"RECIPES":[["Snow Bunny","Spicy Soup"]],
},
27: {"NAME":"Mousse Cake",
"RECIPES":[["Cake Mix"]],
},
28: {"NAME":"Shroom Cake",
"RECIPES":[["Mushroom","Cake Mix"],
["Super Shroom","Cake Mix"],
["Life Shroom","Cake Mix"]],
},
29: {"NAME":"Choco Cake",
"RECIPES":[["Cake Mix","Inky Sauce"],
["Mousse Cake","Inky Sauce"]],
},
30: {"NAME":"Heartful Cake",
"RECIPES":[["Cake Mix","Ruin Powder"],
["Peachy Peach","Ruin Powder"]],
},
31: {"NAME":"Fruit Parfait",
"RECIPES":[
#["Keel Mango","Gradual Syrup"], #Gradual Syrup is never used in evaluation
["Keel Mango","Honey Syrup"],
["Keel Mango","Jammin Jelly"],
["Keel Mango","Maple Syrup"],
["Keel Mango","Peachy Peach"],
["Peachy Peach","Honey Syrup"],
["Peachy Peach","Jammin Jelly"],
["Peachy Peach","Maple Syrup"]],
},
32: {"NAME":"Mango Delight",
"RECIPES":[["Keel Mango","Cake Mix"]],
},
33: {"NAME":"Love Pudding",
"RECIPES":[["Mystic Egg","Mango Delight"]],
},
34: {"NAME":"Zess Cookie",
"RECIPES":[["Mystery"],
#["Cake Mix","Gradual Syrup"], #Unnecessary 2 Ingredients
#["Cake Mix","Maple Syrup"], #Unnecessary 2 Ingredients
#["Cake Mix","Mystic Egg"], #Unnecessary 2 Ingredients
],
},
35: {"NAME":"Shroom Crepe",
"RECIPES":[["Ultra Shroom","Cake Mix"]],
},
36: {"NAME":"Peach Tart",
"RECIPES":[["Peachy Peach","Cake Mix"]],
},
37: {"NAME":"Koopa Tea",
"RECIPES":[["Mystery"],
["Turtley Leaf"]],
},
38: {"NAME":"Zess Tea",
"RECIPES":[["Mystery"],
["Golden Leaf"],
#["Maple Syrup","Jammin Jelly"], #Unnecessary 2 Ingredients
],
},
39: {"NAME":"Shroom Broth",
"RECIPES":[["Golden Leaf","Poison Shroom"],
["Golden Leaf","Slow Shroom"]],
},
40: {"NAME":"Fresh Juice",
"RECIPES":[["Mystery"],
#["Gradual Syrup"], #Gradual Syrup is never used in evaluation
["Honey Syrup"],
["Jammin Jelly"],
["Keel Mango"],
["Maple Syrup"],
["Peachy Peach"],
#["Coconut","Keel Mango"], #Unnecessary 2 Ingredients
#["Coconut","Peachy Peach"], #Unnecessary 2 Ingredients
#["Coconut","Turtley Leaf"], #Unnecessary 2 Ingredients
#["Gradual Syrup","Turtley Leaf"], #Unnecessary 2 Ingredients
#["Gradual Syrup","Honey Syrup"], #Unnecessary 2 Ingredients
#["Honey Syrup","Jammin Jelly"], #Unnecessary 2 Ingredients
#["Honey Syrup","Maple Syrup"], #Unnecessary 2 Ingredients
#["Honey Syrup","Turtley Leaf"], #Unnecessary 2 Ingredients
#["Jammin Jelly","Gradual Syrup"], #Unnecessary 2 Ingredients
#["Jammin Jelly","Turtley Leaf"], #Unnecessary 2 Ingredients
#["Maple Syrup","Gradual Syrup"], #Unnecessary 2 Ingredients
#["Maple Syrup","Turtley Leaf"], #Unnecessary 2 Ingredients
],
},
41: {"NAME":"Inky Sauce",
"RECIPES":[["Hot Sauce","Fresh Juice"],
["Hot Sauce","Koopa Tea"],
#["Hot Sauce","Shroom Broth"], #Infinite recipe recursion Inky Sauce ==> Shroom Broth ==> Poison Shroom ==> Inky Sauce...
["Hot Sauce","Turtley Leaf"],
["Hot Sauce","Zess Tea"],
["Hot Sauce","Tasty Tonic"]],
},
42: {"NAME":"Icicle Pop",
"RECIPES":[["Honey Syrup","Ice Storm"]],
},
43: {"NAME":"Zess Frappe",
"RECIPES":[["Ice Storm","Maple Syrup"],
["Ice Storm","Jammin Jelly"]],
},
44: {"NAME":"Snow Bunny",
"RECIPES":[["Ice Storm","Golden Leaf"]],
},
45: {"NAME":"Coco Candy",
"RECIPES":[["Cake Mix","Coconut"]],
},
46: {"NAME":"Honey Candy",
"RECIPES":[["Honey Syrup","Cake Mix"]],
},
47: {"NAME":"Jelly Candy",
"RECIPES":[["Jammin Jelly","Cake Mix"]],
},
48: {"NAME":"Electro Pop",
"RECIPES":[["Cake Mix","Volt Shroom"]],
},
49: {"NAME":"Fire Pop",
"RECIPES":[["Cake Mix","Fire Flower"],
["Cake Mix","Hot Sauce"]],
},
50: {"NAME":"Space Food",
"RECIPES":[["Dried Bouquet","Cake Mix"],
["Dried Bouquet","Choco Cake"],
["Dried Bouquet","Coco Candy"],
["Dried Bouquet","Coconut"],
["Dried Bouquet","Dried Shroom"],
["Dried Bouquet","Electro Pop"],
["Dried Bouquet","Fire Pop"],
["Dried Bouquet","Fresh Juice"],
["Dried Bouquet","Fried Egg"],
["Dried Bouquet","Fruit Parfait"],
["Dried Bouquet","Golden Leaf"],
["Dried Bouquet","Healthy Salad"],
["Dried Bouquet","Heartful Cake"],
["Dried Bouquet","Honey Candy"],
["Dried Bouquet","Honey Shroom"],
["Dried Bouquet","Honey Super"],
["Dried Bouquet","Honey Ultra"],
["Dried Bouquet","Hot Dog"],
["Dried Bouquet","Icicle Pop"],
["Dried Bouquet","Ink Pasta"],
["Dried Bouquet","Inky Sauce"],
["Dried Bouquet","Jammin Jelly"],
["Dried Bouquet","Jelly Candy"],
["Dried Bouquet","Jelly Shroom"],
["Dried Bouquet","Jelly Super"],
["Dried Bouquet","Jelly Ultra"],
["Dried Bouquet","Keel Mango"],
["Dried Bouquet","Koopa Bun"],
["Dried Bouquet","Koopa Tea"],
["Dried Bouquet","Life Shroom"],
#["Dried Bouquet","Love Pudding"], #Unsure about this one
["Dried Bouquet","Mango Delight"],
["Dried Bouquet","Maple Shroom"],
["Dried Bouquet","Maple Syrup"],
["Dried Bouquet","Maple Ultra"],
["Dried Bouquet","Meteor Meal"],
["Dried Bouquet","Mistake"],
["Dried Bouquet","Mousse Cake"],
["Dried Bouquet","Mushroom"],
["Dried Bouquet","Mystic Egg"],
["Dried Bouquet","Omelette Meal"],
["Dried Bouquet","Peachy Peach"],
#["Dried Bouquet","Peach Tart"], #Unsure about this one
["Dried Bouquet","Shroom Cake"],
["Dried Bouquet","Shroom Crepe"],
["Dried Bouquet","Shroom Fry"],
["Dried Bouquet","Shroom Roast"],
["Dried Bouquet","Shroom Steak"],
["Dried Bouquet","Snow Bunny"],
["Dried Bouquet","Spaghetti"],
["Dried Bouquet","Spicy Pasta"],
["Dried Bouquet","Spicy Soup"],
["Dried Bouquet","Super Shroom"],
#["Dried Bouquet","Trial Stew"], #Unsure about this one
["Dried Bouquet","Turtley Leaf"],
["Dried Bouquet","Ultra Shroom"],
["Dried Bouquet","Zess Cookie"],
["Dried Bouquet","Zess Deluxe"],
["Dried Bouquet","Zess Dinner"],
["Dried Bouquet","Zess Frappe"],
["Dried Bouquet","Zess Special"],
["Dried Bouquet","Zess Tea"],
],
},
51: {"NAME":"Poison Shroom",
"RECIPES":[["Inky Sauce","Slow Shroom"],
#["Point Swap","Slow Shroom"], #Point Swap is never used in evaluation
],
},
52: {"NAME":"Trial Stew",
"RECIPES":[["Poison Shroom","Couples Cake"]],
},
53: {"NAME":"Courage Meal",
"RECIPES":[["Courage Shell","Zess Deluxe"],
["Courage Shell","Zess Dinner"],
["Courage Shell","Zess Special"]],
},
54: {"NAME":"Coconut Bomb",
"RECIPES":[["Coconut","Fire Flower"]],
},
55: {"NAME":"Egg Bomb",
"RECIPES":[["Mystery"],
#["Dried Bouquet","Zess Dynamite"], #Unnecessary 2 Ingredients
#["Mystic Egg","Fire Flower"], #Unnecessary 2 Ingredients
],
},
56: {"NAME":"Zess Dynamite",
"RECIPES":[["Egg Bomb","Coconut Bomb"]],
},
57: {"NAME":"Mistake",
"RECIPES":[["Shroom Fry"],
["Shroom Roast"],
["Shroom Steak"],
["Honey Shroom"],
["Maple Shroom"],
["Jelly Shroom"],
["Honey Super"],
["Maple Super"],
["Jelly Super"],
["Honey Ultra"],
["Maple Ultra"],
["Jelly Ultra"],
["Zess Dinner"],
["Zess Special"],
["Zess Deluxe"],
["Spaghetti"],
["Koopasta"],
["Spicy Pasta"],
["Ink Pasta"],
["Spicy Soup"],
["Fried Egg"],
["Omelette Meal"],
["Koopa Bun"],
["Healthy Salad"],
["Meteor Meal"],
["Couples Cake"],
["Mousse Cake"],
["Shroom Cake"],
["Choco Cake"],
["Heartful Cake"],
["Fruit Parfait"],
["Mango Delight"],
["Love Pudding"],
["Zess Cookie"],
["Shroom Crepe"],
["Peach Tart"],
["Koopa Tea"],
["Zess Tea"],
["Shroom Broth"],
["Fresh Juice"],
["Inky Sauce"],
["Icicle Pop"],
["Zess Frappe"],
["Snow Bunny"],
["Coco Candy"],
["Honey Candy"],
["Jelly Candy"],
["Electro Pop"],
["Fire Pop"],
["Space Food"],
["Poison Shroom"],
["Trial Stew"],
["Courage Meal"],
["Coconut Bomb"],
["Egg Bomb"],
["Zess Dynamite"]],
},
58: {"NAME":"Dried Bouquet", #When this ingredient is fulfilled, we also have to add Coconut, Courage Shell, and Keel Mango
"RECIPES":[["Hot Dog","Mousse Cake"]],
},
}
#randomize moves for step 1-20
randomize = True
#interesting way to pick legal moves
select = False
#log individual process state every 100000 iterations
log_calls = True
ITEM_NAMES = []
#These items are listed in Japanese, which is why they don't actually look alphabetic
#Comment Out Items that will never be encountered to save time on sorting moves
ALPHABETIC_SORT = [
#"POW Block",
"Icicle Pop",
#"Fright Mask",
"Spicy Soup",
"Ink Pasta",
"Couples Cake",
#"Point Swap",
"Space Food",
"Ultra Shroom",
"Golden Leaf",
"Cake Mix",
"Courage Shell",
"Courage Meal",
"Thunder Bolt",
#"Thunder Rage",
"Koopa Tea",
"Turtley Leaf",
"Koopasta",
#"[Koopa Curse]",
"Koopa Bun",
"Spicy Pasta",
"Omelette Meal",
"Mushroom",
"Shroom Fry",
"Shroom Crepe",
"Shroom Cake",
"Shroom Steak",
"Shroom Roast",
"Shooting Star",
#"Gold Bar",
#"Gold Bar x 3",
"Life Shroom",
#"Dizzy Dial",
#"[Cake]",
"Shroom Broth",
"Ice Storm",
"Coconut Bomb",
"Coco Candy",
#"Spite Pouch",
"Mistake",
"Dried Shroom",
#"Inn Coupon",
"Choco Cake",
"Trial Stew",
"Slow Shroom",
"Gradual Syrup",
"Super Shroom",
#"HP Drain",
"Tasty Tonic",
#"Stopwatch",
"Spaghetti",
"Inky Sauce",
#"Whacka Bump",
#"Horsetail",
#"[Trade Off]",
#"Repel Cape",
#"Boos Sheet",
#"Power Punch",
"Keel Mango",
"Poison Shroom",
"Dried Bouquet",
"Mystery",
"Zess Cookie",
"Zess Special",
"Zess Dynamite",
"Zess Tea",
"Zess Dinner",
"Zess Deluxe",
"Zess Frappe",
#"Sleepy Sheep",
"Love Pudding",
"Honey Candy",
"Honey Shroom",
"Honey Super",
"Honey Ultra",
"Honey Syrup",
"Egg Bomb",
"Volt Shroom",
"Electro Pop",
"Peach Tart",
"Peachy Peach",
"Fire Pop",
"Fire Flower",
"Mystic Egg",
#"Mr. Softener",
"Fruit Parfait",
"Fresh Juice",
"Healthy Salad",
"Meteor Meal",
"Hot Dog",
"Ruin Powder",
"Mango Delight",
#"Mini Mr. Mini",
"Mousse Cake",
"Maple Shroom",
"Maple Super",
"Maple Ultra",
"Maple Syrup",
"Fried Egg",
"Heartful Cake",
"Coconut",
"Snow Bunny",
#"Earth Quake",
"Hot Sauce",
"Jelly Shroom",
"Jelly Super",
"Jelly Ultra",
"Jelly Candy",
"Jammin Jelly",
"Fresh Pasta",
]
#Comment Out Items that will never be encountered to save time on sorting moves
TYPE_SORT = [
#"[Koopa Curse]",
"Mushroom",
"Super Shroom",
"Ultra Shroom",
"Life Shroom",
"Slow Shroom",
"Dried Shroom",
"Honey Syrup",
"Maple Syrup",
"Jammin Jelly",
"Gradual Syrup",
"Tasty Tonic",
#"POW Block",
"Fire Flower",
"Ice Storm",
"Earth Quake",
"Thunder Bolt",
"Thunder Rage",
"Shooting Star",
"Volt Shroom",
"Repel Cape",
"Boos Sheet",
"Ruin Powder",
#"Sleepy Sheep",
#"Dizzy Dial",
#"Stopwatch",
#"Power Punch",
#"Mini Mr. Mini",
"Courage Shell",
#"Mr. Softener",
#"[Trade Off]",
#"HP Drain",
#"Point Swap",
#"Fright Mask",
"Mystery",
#"Inn Coupon",
#"Gold Bar",
#"Gold Bar x 3",
#"Whacka Bump",
"Hot Dog",
#"[Cake]",
"Coconut",
"Dried Bouquet",
"Mystic Egg",
"Golden Leaf",
"Keel Mango",
"Fresh Pasta",
"Cake Mix",
"Hot Sauce",
"Turtley Leaf",
#"Horsetail",
"Peachy Peach",
"Spite Pouch",
"Shroom Fry",
"Shroom Roast",
"Shroom Steak",
"Honey Shroom",
"Maple Shroom",
"Jelly Shroom",
"Honey Super",
"Maple Super",
"Jelly Super",
"Honey Ultra",
"Maple Ultra",
"Jelly Ultra",
"Zess Dinner",
"Zess Special",
"Zess Deluxe",
"Spaghetti",
"Koopasta",
"Spicy Pasta",
"Ink Pasta",
"Spicy Soup",
"Fried Egg",
"Omelette Meal",
"Koopa Bun",
"Healthy Salad",
"Meteor Meal",
"Couples Cake",
"Mousse Cake",
"Shroom Cake",
"Choco Cake",
"Heartful Cake",
"Fruit Parfait",
"Mango Delight",
"Love Pudding",
"Zess Cookie",
"Shroom Crepe",
"Peach Tart",
"Koopa Tea",
"Zess Tea",
"Shroom Broth",
"Fresh Juice",
"Inky Sauce",
"Icicle Pop",
"Zess Frappe",
"Snow Bunny",
"Coco Candy",
"Honey Candy",
"Jelly Candy",
"Electro Pop",
"Fire Pop",
"Space Food",
"Poison Shroom",
"Trial Stew",
"Courage Meal",
"Coconut Bomb",
"Egg Bomb",
"Zess Dynamite",
"Mistake",
]
#How many frames does it take to select an inventory item?
INV_FRAMES = [
[], #0 Items
[0], #1 Item
[0,0], #2 Items
[0,0,0], #3 Items
[0,0,2,0], #4 Items
[0,0,2,2,0], #5 Items
[0,0,2,4,2,0], #6 Items
[0,0,2,4,4,2,0], #7 Items
[0,0,2,4,6,4,2,0], #8 Items
[0,0,2,4,6,6,4,2,0], #9 Items
[0,0,2,4,6,8,6,4,2,0], #10 Items
[0,0,2,4,6,8,8,6,4,2,0], #11 Items
[0,0,2,4,6,8,10,8,6,4,2,0], #12 Items
[0,0,2,4,6,8,10,10,8,6,4,2,0], #13 Items
[0,0,2,4,6,8,10,12,10,8,6,4,2,0], #14 Items
[0,0,2,4,6,8,10,12,12,10,8,6,4,2,0], #15 Items
[0,0,2,4,6,8,10,12,14,12,10,8,6,4,2,0], #16 Items
[0,0,2,4,6,8,10,12,14,14,12,10,8,6,4,2,0], #17 Items
[0,0,2,4,6,8,10,12,14,16,14,12,10,8,6,4,2,0], #18 Items
[0,0,2,4,6,8,10,12,14,16,16,14,12,10,8,6,4,2,0], #19 Items
[0,0,2,4,6,8,10,12,14,16,18,16,14,12,10,8,6,4,2,0], #20 Items
[0,0,2,4,6,8,10,12,14,16,18,18,16,14,12,10,8,6,4,2,0], #21 Items
]
################################################################################
# With the given inventory and knolwedge of which outputs have already been created,
# Determine if the given recipe can be fulfilled
################################################################################
def check_ingredients(recipe, inventory, has_output_been_created, level=0):
for item in recipe:
if item in inventory:
#This item is in the current inventory, do nothing for now
pass
elif item in ITEM_NAMES and (not has_output_been_created[ITEM_NAMES.index(item)]):
#This item is not in the current inventory, but it is another output item that hasn't been made yet
#Check all recipes of the output item to see if it can be made with the current inventory.
if(level < 3):
#Don't evaluate any further than the 3rd recursion level
#Done to avoid infinite recipe loops (Inky Sauce > Shroom Broth > Poison Shroom > Inky Sauce > ...)
temp_good_recipe = False
for new_recipe in ITEMS[ITEM_NAMES.index(item)+1]["RECIPES"]:
#Check to see if this ingredient can be made with other ingredients the player has
if(check_ingredients(new_recipe, inventory, has_output_been_created,level+1)):
#At least one recipe can be fulfilled now.
temp_good_recipe = True
#After evaluating all recipes of the ITEM, if that ITEM cannot be produced, return false
if(not temp_good_recipe):
return False
else:
return False
else:
#The item isn't in the inventory, and can't be made through another recipe, return False
return False
#By getting here, we know all ingredients are at least possible to create still with the current inventory
return True
################################################################################
# With the given inventory, determine if the remaining output items be fulfilled
################################################################################
def check_ingredients(recipe, inventory, has_output_been_created):
################print("Inside C_I: {0}".format(recipe))
for item in recipe:
if item in inventory:
#This item is in the current inventory, do nothing for now
pass
elif item in ITEM_NAMES and (not has_output_been_created[ITEM_NAMES.index(item)]):
temp_good_recipe = False
for new_recipe in ITEMS[ITEM_NAMES.index(item)+1]["RECIPES"]:
#Recurse on all recipes that can make this ITEM
temp_output_created = copy.copy(has_output_been_created)
temp_output_created[ITEM_NAMES.index(item)] = True
temp_good_recipe = temp_good_recipe or check_ingredients(new_recipe, inventory, temp_output_created)
#After evaluating all recipes of the ITEM, if that ITEM cannot be produced, return false
if(not temp_good_recipe):
return False
else:
#The item isn't in the inventory, and can't be made through another recipe, return False
return False
#By getting here, we know all ingredients are at least possible to create still with the current inventory
return True
################################################################################
# With the given inventory, can the remaining recipes be fulfilled?
################################################################################
def remainingOutputsCanBeFulfilled(inventory, has_output_been_created):
#Iterate through all remaining output items
for output_item in ITEMS:
#Only want output items that haven't already been created elsewhere
if(not has_output_been_created[output_item-1]):
#Iterate through all recipes
viable_ingredients_found = False
for recipe in ITEMS[output_item]["RECIPES"]:
#This is done to avoid infinite recursion
#TODO: Check if there's a more efficient algorithm
temp_output_created = copy.copy(has_output_been_created)
temp_output_created[output_item-1] = True
viable_ingredients_found = viable_ingredients_found or check_ingredients(recipe, inventory, temp_output_created)
if(not viable_ingredients_found):
#There's a few exceptions
if(has_output_been_created[57]):
#the 58th "output" is really a representation of the Chapter 5 Intermission
#Where the Keel Mango and Coconut are collected, so a few recipes before this intermission won't be viable
#If chapter 5 has been done, then there's no exceptions anymore
#if(print_debug):
# print("Couldn't make product {0}".format(ITEM_NAMES[output_item-1]))
return False
elif(ITEMS[output_item]["NAME"] in ["Zess Dinner",
"Koopa Bun",
"Fruit Parfait",
"Mango Delight",
"Love Pudding",
"Fresh Juice",
"Coco Candy",
"Courage Meal",
"Coconut Bomb",
"Zess Dynamite"]):
#This has flaws, but any items that need Keel Mangos or Coconuts
#will be considered fine for pre-Chapter-5 evaluation
pass
else:
### print("THIS OUTPUT IS NO LONGER VIABLE!!!")
#Any other output items will need something that we *should* have
return False
#Haven't returned false in evaluating all output items
#Meaning that all remaining outputs can still be fulfilled!
return True
#####################################################################################
# Print the Results of all states observed in the current stack
#####################################################################################
def print_results(filename,written_step,frames_taken,total_frames,inventory,output_created):
f = open(filename,"w")
#Write Header information
f.write("Description\tFrames Taken\tTotal Frames")
for z in range(0,20):
f.write("\tSlot #{0}".format(z+1))
for z in range(0,58):
f.write("\t{0}".format(ITEM_NAMES[z]))
f.write("\n")
#Data Information
for i in range(0,step_index+1):
f.write("{0}\t{1}\t{2}".format(written_step[i],frames_taken[i],total_frames[i]))
for z in range(0,20):
f.write("\t{0}".format(inventory[i][z]))
for z in range(0,58):
f.write("\t{0}".format(output_created[i][z]))
f.write("\n")
f.close()
#################################################################
# Get the insertion index for where to place this legal move
#################################################################
def get_insertion_index(legal_moves, step_index, frames):
temp_index = 0
while(temp_index < len(legal_moves[step_index]) and legal_moves[step_index][temp_index][2] < frames):
temp_index += 1
return temp_index
#####################################################################################
# MAIN SUBROUTINE
#####################################################################################
#Fill the ITEM_NAMES
for item in ITEMS:
ITEM_NAMES.append(ITEMS[item]["NAME"])
#Check that all inputted recipes and ingredients are in the list
for i in ITEMS:
if(ITEMS[i]["NAME"] not in ALPHABETIC_SORT):
print("Item '{0}' not in Alphabetic Sort list".format(ITEMS[i]["NAME"]))
input()
if(ITEMS[i]["NAME"] not in TYPE_SORT):
print("Item '{0}' not in Type Sort list".format(ITEMS[i]["NAME"]))
input()
for j in ITEMS[i]["RECIPES"]:
for x in j:
if x not in ALPHABETIC_SORT:
print ("Ingredient '{0}' not in Alphabetic Sort list".format(x))
input()
if x not in TYPE_SORT:
print ("Ingredient '{0}' not in Type Sort list".format(x))
input()
#print("All Items Checked to be in Alphabetic List")
#===============================================================================
# GOAL
#===============================================================================
# The goal of this program is to find a roadmap of fulfilling all 57 Zess T.
# recipes in as few frames as possible.
#===============================================================================
# RULES & ASSUMPTIONS
#===============================================================================
# A known glitch has been exploited that allows the ability to duplicate ingredient items
# If you use an ingredient in slots 1-10, that slot becomes "NULL" and isn't duplicated
# If you use an ingredient in slots 11-20, the item is duplicated
# If there's a NULL slot, the recipe output will automatically fill the 1st NULL position
# If there's no NULL slots, the player is given the option of tossing either the output item,
# or replacing any inventory in the first 10 slots item with the output item
# Attempting to replace an inventory itel in slots 11-20 will leave the inventory unchanged
# (In this instance, it's always faster to just toss the output item outright)
# If there's a sort, all NULL slots are wiped away and are no longer available, becoming "BLOCKED" at the end of the inventory
# "BLOCKED" spaces are assumed to be permanently unavailable for the remainder of recipe fulfillment
# When navigating the inventory, it is assumed all "NULL" and "BLOCKED" spaces are hidden from the player
# For example, if 2 spaces are NULL, the player will only see the other 18 items to navigate through in the inventory
# The first recipe that is fulfilled can only use a single ingredient
# At some point, the player needs to trade 2 Hot Dogs and a Mousse Cake for a Dried Bouquet (Which is only needed for the Space Food recipe)
# At another point, the player will need to collect the Keel Mango, Coconut, and Courage Shell after Chapter 5
# So there's 2 sessions of recipe-fulfillment that will be needed (Pre-Ch.5 and Post-Ch.5)
#===============================================================================
# Algorithm Description
#===============================================================================
# Start Loop
# Iterate through all Items that haven't been made already
# Iterate through all their recipes that can be made with the current materials
# Iterate through all placement options of the output ingredient (Tossing, Autofill, etc)
# Determine how many relevant frames are required to fulfill this recipe and add it to a list of "legal moves" for the current state
# Pick the Legal Move that takes the least frames, update the inventory based on that move, and recurse the loop again
# If no legal moves are available and the end-state has not been reached,
# then return back up a layer and pick the next-fastest legal move at that state to recurse down
# Repeat recursion until search space has been exhausted
#===============================================================================
#frame_record is now set in async call
#frame_record = 9999 #4409
#Total frames to choose an additional ingredient (As opposed to just a single ingredient)
#This does not include the additional frames needed to navigate to the items that you want to use
CHOOSE_SECOND_INGREDIENT_FRAMES = 56
#Total frames to toss any item (As opposed to the item being automatically placed in a NULL space)
#This does not include the additional frames needed to navigate to the item that you want to toss
TOSS_FRAMES = 23
#Frames needed to sort the inventory by each method
ALPHA_SORT_FRAMES = 38
REVERSE_ALPHA_SORT_FRAMES = 40
TYPE_SORT_FRAMES = 39
REVERSE_TYPE_SORT_FRAMES = 41
#If the player does not toss the final output item, 5 extra frames are needed to obtain jump storage
JUMP_STORAGE_NO_TOSS_FRAMES = 5
while(True):
step_index = 0
iteration_count = 0
#The Beginning Inventory
STARTING_INVENTORY = []
#Read in the starting inventor
f = open("inventory.txt","r")
for lines in f:
ingredient = lines.strip("\n")
if(not ingredient in ALPHABETIC_SORT):
#print("Error: ({0}) Not Found in Alphabetic Sort List!".format(ingredient))
input()