Ejemplo n.º 1
0
        public void Reset()
        {
            StackStack.Clear();
            FundgeSpace.Clear();

            this.instructionPointer = new FungeSpacePointer();
            this.instructionPointerDirection = new FungeSpaceDirection(1, 0);
        }
Ejemplo n.º 2
0
 public FungeEngine()
 {
     this.fundgeSpace = new FungeSpace();
     this.stackStack = new StackStack();
     this.instructionPointer = new FungeSpacePointer();
     this.instructionPointerDirection = new FungeSpaceDirection(1, 0);
     this.randomizer = new Random();
 }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
 public byte this[FungeSpacePointer pointer]
 {
     get { return this[pointer.X, pointer.Y]; }
     set { this[pointer.X, pointer.Y] = value; }
 }