If Heads is a control chip that makes a random decision for your ChipWit, simulating a coin flip. It’s useful for adding randomness to your ChipWit’s behavior, helping it decide between two paths or actions.
Specifications #
- Argument: None
- Creates a True or False Branch?: Yes, it does create a T/F branch
- Number of Cycles Used: 3
- Range: 0
- Fuel: 1
Example of Use #
Let’s say you want your ChipWit to randomly decide whether to skate forward or skate left when it reaches a crossroad:
- Place the If Heads chip in the program.
- After the If Heads chip, place a Skate Forward operator on one path (true) and a Skate Left operator on the other path (false).
- When the ChipWit reaches this part of the program, it will flip a virtual coin and either Skate forward or Skate left, depending on the result.
This adds an element of randomness to your ChipWit’s movement, making it behave unpredictably at key decision points.
History #
“If Heads” as it appears in various historic incarnations of ChipWits!
COMMODORE 64:
MANUAL:
“In several of the games, you may need to have your CHIPWIT “flip a coin’’ to decide what to do next. Say you want to find an object, but you don’t know where it is—it could be to the left, but on the other hand it might be to the right. Use the Coin Flip instruction to make the decision.
When this chip is executed, the CHIPWIT will pick TRUE or FALSE at random. Half of the time, control will pass to the TRUE branch. The other half of the time, the program will follow the FALSE branch.”
APPLE II:
MANUAL:
“COIN FLIP generates a random choice for a branch from the chip’s true or false wires.”
CHIPWITS II (WINDOWS 95):
Leave a Reply