コード例 #1
0
ファイル: FungeEngine.cs プロジェクト: notmasteryet/esoteric
        public void Reset()
        {
            StackStack.Clear();
            FundgeSpace.Clear();

            this.instructionPointer = new FungeSpacePointer();
            this.instructionPointerDirection = new FungeSpaceDirection(1, 0);
        }
コード例 #2
0
ファイル: FungeEngine.cs プロジェクト: notmasteryet/esoteric
 public FungeEngine()
 {
     this.fundgeSpace = new FungeSpace();
     this.stackStack = new StackStack();
     this.instructionPointer = new FungeSpacePointer();
     this.instructionPointerDirection = new FungeSpaceDirection(1, 0);
     this.randomizer = new Random();
 }
コード例 #3
0
ファイル: FungeEngine.cs プロジェクト: notmasteryet/esoteric
        private void MoveOnePosition()
        {
            instructionPointer += instructionPointerDirection;

            // wrapping
            if (InstructionPointer.X < FungeSpace.MinX)
                instructionPointer.X = FungeSpace.MaxX;
            else if (InstructionPointer.X > FungeSpace.MaxX)
                instructionPointer.X = FungeSpace.MinX;
            else if (InstructionPointer.Y < FungeSpace.MinY)
                instructionPointer.Y = FungeSpace.MaxY;
            else if (InstructionPointer.Y > FungeSpace.MaxY)
                instructionPointer.Y = FungeSpace.MinY;
        }
コード例 #4
0
ファイル: FungeSpace.cs プロジェクト: notmasteryet/esoteric
 public byte this[FungeSpacePointer pointer]
 {
     get { return this[pointer.X, pointer.Y]; }
     set { this[pointer.X, pointer.Y] = value; }
 }