DECREMENT


The Decrement chip reduces the value of a specified memory cell by 1, often used for controlling loops or countdowns in your ChipWit’s program.


Specifications #

  • Arguments: None
  • Creates a True or False Branch?: No, Decrement does not create a True/False branch.
  • Number of Cycles Used: 1
  • Fuel: 1


Example of Use #

Your ChipWit needs to Zap three Electrocrabs, but after the third Zap, it should stop Zapping and start Skating to the right. Here’s how to set it up:

  1. Set Up Push Number Chip:
    • Use the Push Number chip with “3” as the argument (representing the number of Electrocrabs to zap).
  2. Zap Electrocrabs:
    • Place an If See Electrocrab chip in your program to detect nearby Electrocrabs.
    • When an Electrocrab is detected, the ChipWit will zap it using the Zap operator.
  3. Use the Decrement Chip:
    • After each Zap, use the Decrement chip to reduce the value in the register by 1. This will count down from 3 to 0 with each zap.
  4. Conditional Check:
    • Add an If Number Equals chip to check when the register equals 0 (indicating all Electrocrabs have been zapped).
    • Once the register hits 0, the ChipWit will stop Zapping and switch to Skate Right to continue moving.

The Decrement chip is crucial for managing loops or countdowns, allowing your ChipWit to perform repeated actions with precision and stop when necessary.


History #

“Decrement” as it appears in various historic incarnations of ChipWits!


COMMODORE 64:

MANUAL:




APPLE II:






CHIPWITS II (WINDOWS 95):

Powered by BetterDocs

Leave a Reply

Your email address will not be published. Required fields are marked *