public void Reset() { StackStack.Clear(); FundgeSpace.Clear(); this.instructionPointer = new FungeSpacePointer(); this.instructionPointerDirection = new FungeSpaceDirection(1, 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(); }
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; }
public byte this[FungeSpacePointer pointer] { get { return this[pointer.X, pointer.Y]; } set { this[pointer.X, pointer.Y] = value; } }