
The If Direction Equals chip is used to check the current direction your ChipWit is facing. It allows your ChipWit to make decisions based on its orientation in the environment, which is critical for navigation and controlling movement.
Specifications #
- Argument: Forward, Backward, Left, Right, Nil (nil means there is nothing on the stack)
- Creates a True or False Branch?: Yes, it does create a T/F branch
- Number of Cycles Used: 2
- Fuel: 1
How It Works #
- When the ChipWit reaches the If Direction Equals chip, it checks the direction on the top of the Move stack.
- You provide an argument (such as Forward, Backwards, Right, or Left) to compare the current direction with.
- If the directions are the same, the program executes through its True branch.
- If the direction is NOT the same, the program executes through its False branch.
If Direction Equals commands the ChipWit to examine the move on the top of the Move Stack and compare it to a specified move (the Argument).
If the moves are the same, the program executes through the true branch of the If Direction Equals chip.
If the moves are different, the program executes through the False branch of the If Direction Equals chip.
The Arguments represent the move that you want the ChipWit to compare to the move at the top of the Move Stack. They are the four directional arrows and the empty square (NIL — the bottom of the Stack). The empty square represents the bottom of the Move Stack. If the Move Stack is empty, and you use this Argument, the chip will execute through its true branch.
Why It Matters #
The If Direction Equals chip is crucial for controlling precise movement and actions. By checking the ChipWit’s orientation, you can fine-tune how it interacts with its environment, ensuring it makes the right moves and performs actions at the right time. This is especially important in complex mazes or missions where direction matters.
History #
“If Direction Equals” as it appears in various historic incarnations of ChipWits!
COMMODORE 64:
MANUAL:
“Using the Compare Thing, Compare Move, and Compare Number Operators, a CHIPWIT can check an argument against the top of any Stack, and branch (TRUE) if they are identical (i.e., Equal To). “
APPLE II:
MANUAL:
“COMPARE MOVE commands the ChipWit to examine the move on the top of the Move Stack and compare it to a specified move.
If the moves are the same, the program branches through the COMPARE MOVE chip’s true wire. If the moves are different, the program branches through the COMPARE MOVE chip’s false wire.
The Argument of the COMPARE MOVE chip represents the move you want the ChipWit to compare to the move at the top of the Move Stack. They are the four directional arrows and the empty square. The empty square represents the bottom of the Move Stack. If the Move Stack is empty, and you use this Argument, the chip will branch through its true wire.”
MAC:
MANUAL:
“COMPARE MOVE commands the ChipWit to examine the move on the top of the Move Stack and compare it to a specified move (the Argument). If the moves are the same, the program branches through the true wire of the COMPARE MOVE chip.
If the moves are different, the program branches through the false wire of the COMPARE MOVE chip.
The Arguments represent the move that you want the ChipWit to compare to the move at the top of the Move Stack. They are the four directional arrows and the empty square. The empty square represents the bottom of the Move Stack. If the Move Stack is empty, and you use this Argument, the chip will branch through its true wire.”
CHIPSWITS II (WIN 95):