Assertions are like checkpoints that make sure everything is going as it should while you're playing a game.
Imagine you’re building a tower with blocks. Every time you add a new block, you check if it's steady and fits the pattern you’ve chosen. If it’s not, you know something went wrong, maybe the block was placed incorrectly or it’s the wrong shape.
Like a Special Helper
Think of an assertion as a special helper who checks your work as you go along. For example, if you’re writing a story and you say "The cat is black," the helper will make sure that stays true, if later in the story the cat turns white, the helper will point it out.
What Happens If It Fails?
If an assertion finds a mistake, it’s like getting a red flag in your game. You know you need to go back and fix something before moving forward. This helps you catch mistakes early and keep your game, or your story, from getting confusing.
Assertions are just simple checks that help you stay on track, one step at a time!
Examples
- A child says, 'I am hungry.' This is an assertion because it expresses a belief about the current state of the world.
- If you say, 'It is raining outside,' that's an assertion, a simple statement of fact.
- When someone claims, 'The moon is made of cheese,' they're making an assertion, even if it’s not true.
Ask a question
See also
- How do we express logic?
- What are write and understand computer programs?
- What are statements?
- What is Which are statements assumed or known to be true, and a?
- How Does 03-7-05 Cogent Arguments - An Example Work?