コード例 #1
0
ファイル: Day14.cs プロジェクト: AlFasGD/AdventOfCode
            public override void RunCommand(MemorySystemCommand command)
            {
                if (command is not MemoryWriteCommand writeCommand)
                {
                    base.RunCommand(command);
                    return;
                }

                var address      = writeCommand.GetVersion2MemoryAddress(CurrentMask);
                var combinations = BitManipulations.GetCombinationsFromMask(address.FloatingBitsMask, 36);

                foreach (var c in combinations)
                {
                    Memory[address.MaskedBaseMemoryAddress | c] = writeCommand.NewValue;
                }
            }
コード例 #2
0
 public BitManipulationsTests()
 {
     _bitManipulations = new BitManipulations();
 }