
The Push Number chip allows your ChipWit to push a specific number onto the stack, where it can be used later for comparisons, arithmetic operations, or decisions. This number stays on the stack until your ChipWit performs an operation that uses or modifies it.
Specifications #
- Argument: Numbers 0-7, Damage Register, Range Register, Fuel Register
- Creates a True or False Branch?: Yes, it does create a T/F branch
- Number of Cycles Used: 1
- Fuel: 1
Why the Push Number Chip Matters #
- Stack-Based Programming: The Push Number chip is key to stack-based logic in ChipWits, allowing your ChipWit to store numerical values temporarily for future use.
- Flexible Applications: You can use the numbers stored by Push Number for tasks like comparisons (using If Number Equals or If Number is Less Than), loops, or as counters to control how many times an action should repeat.
- Efficient Number Handling: This chip makes it easy to manage numerical data without needing to store values elsewhere in your program, keeping everything compact and organized.
How to Use the Push Number Chip #
- Place the Push Number chip in your program and specify a number to push onto the stack (e.g., 0, 5, etc.)
- Once the number is on the stack, it can be used in other operations like If Number Equals or Increment and Decrement.
- Each time the Push Number chip is executed, the number is stored on the stack, ready for later instructions.
Example of Use #
- Imagine your ChipWit needs to repeat an action 5 times. You could use the Push Number chip to store the number 5 on the stack.
- Next, you could use a loop combined with Decrement and If Number Equals to count down from 5 to 0, performing the action each time.
The Push Number chip is essential for more advanced logic and math in your ChipWit’s programming, providing a way to work with numerical values dynamically.
History #
“Push Number” as it appears in various historic incarnations of ChipWits!
COMMODORE 64:
MANUAL:
“An argument is saved or “pushed” on the top of a Stack using the Save Number Operator. “
APPLE II:
MANUAL:
“SAVE NUMBER commands the ChipWit to put a value into the Number Stack. This is the way the ChipWit makes the list of values that constitutes the Number Stack. Uses of the Number Stack are discussed in Chapter II.
The Arguments for SAVE NUMBER are the numbers you want the robot to put into the stack. They are the numbers 0 through 7 (as represented by the beakers), the values from the Fuel and Damage Meters, and the current reading from the Range Finder.”
MAC:
MANUAL:
“SAVE NUMBER commands the ChipWit to put a value into the Number Stack. This is the way the ChipWit makes the list of values that constitutes the Number Stack. Uses of the Number Slack are discussed in Chapter II.
The Arguments for SAVE NUMBER are the numbers to be put into the stack. They are the numbers 0 through 7 (as represented by the beakers), and the values from the Fuel and Damage Meters, and the current reading from the Range Finder.”
CHIPWITS II (WIN 95):