示例#1
0
        public static void PrintIdealPendulumManipulation(uint pendulumAddress, int numIterations, bool useForm)
        {
            List <List <int> > dustFrameLists = TtcMain.FindIdealPendulumManipulation(pendulumAddress, numIterations);
            List <string>      outputList     = dustFrameLists.ConvertAll(dustFrameList => "[" + String.Join(", ", dustFrameList) + "]");
            string             output         = String.Join("\r\n", outputList);

            if (useForm)
            {
                InfoForm.ShowValue(output, "Pendulum Manipulation", "Dust Frames");
            }
            else
            {
                Config.Print(output);
            }
        }
示例#2
0
        public void FindMovingBarManipulationGivenFrame1(List <int> dustFrames, int frame1)
        {
            TtcPendulum closePendulum = GetClosePendulum();
            TtcPendulum farPendulum   = GetFarPendulum();
            TtcPusher   middlePusher  = GetMiddlePusher();
            TtcPusher   upperPusher   = GetUpperPusher();

            int?pendulumAngleCounter = null;

            int counter = 0;
            int frame   = _startingFrame;

            while (true)
            {
                counter++;
                frame++;
                foreach (TtcObject rngObject in _rngObjects)
                {
                    rngObject.SetFrame(frame);
                    rngObject.Update();
                }

                if (counter == 142)
                {
                    if (!middlePusher.IsExtended())
                    {
                        return;
                    }
                }

                if (counter > 142 &&
                    middlePusher.IsRetracting() &&
                    middlePusher._timer < 50 &&
                    closePendulum._angle == 27477 &&
                    upperPusher.IsExtended())
                {
                    pendulumAngleCounter = counter;
                    Config.Print("SUCCESS\t{0}\t{1}\t{2}", frame1, frame, TtcMain.FormatDustFrames(dustFrames));
                }

                if (counter == 300)
                {
                    return;
                }
            }
        }