public static void IGT(int delay, string path) { MakeSave(); IGTResults res = Gsc.IGTCheckParallel(MultiThread.MakeThreads <Gold>(8), 120, new GscIntroSequence(delay, GscStrat.GfSkip, GscStrat.TitleSkip, GscStrat.Continue), 60, gb => gb.Execute(path) == gb.OverworldLoopAddress); Console.WriteLine(res.TotalSuccesses + " (RNG: " + res.RNGSuccesses(10) + ")"); }
public static string CleanUpPathParallel <Gb>(Gb[] gbs, IGTResults initialStates, int ss, params Action[] path) where Gb : Gsc { List <int> aPressIndices = new List <int>(); for (int i = 0; i < path.Length; i++) { if ((path[i] & Action.A) > 0) { aPressIndices.Add(i); } } foreach (int index in aPressIndices) { path[index] &= ~Action.A; int successes = Gsc.IGTCheckParallel(gbs, initialStates, gb => gb.Execute(path) == gb.SYM["OWPlayerInput"]).TotalSuccesses; if (successes < ss) { path[index] |= Action.A; } } return(ActionFunctions.ActionsToPath(path)); }
public static void EndSearch(int numThreads, int delay, string path, int ss) { Gold[] gbs = MultiThread.MakeThreads <Gold>(numThreads); byte[][] initialStates = Gsc.IGTCheckParallel(gbs, 120, new GscIntroSequence(delay, GscStrat.GfSkip, GscStrat.TitleSkip, GscStrat.Continue), 60, gb => gb.Execute(path) == gb.OverworldLoopAddress).States; R29(gbs, initialStates, r29[38, 16]); }