# Heads or Tails

We teach Brainhat to play *heads-or-tails*. The first to reach a score of 5 wins:

```
>> your score is 0.
my score belonging to I is 0.
>> my score is 0.
your score belonging to You is 0.
>> if i say heads then add 1 to your score.
if You say head then add 1 number to my score.
>> if i say tails then add 1 to my score.
if You say tail then add 1 number to your score.
>> if my score is 5 then i am the winner and you are the loser.
if your score is 5 then You are the winner and I am the loser.
>> if your score is 5 then you are the winner and i am the loser.
if my score is 5 then I am the winner and You are the loser.
>> heads.
head.
my score belonging to I is 1.
>> heads.
head.
my score belonging to I is 2.
>> tails.
tail.
your score belonging to You is 1.
>> tails.
tail.
your score belonging to You is 2.
>> heads.
head.
my score belonging to I is 3.
>> heads.
head.
my score belonging to I is 4.
>> tails.
tail.
your score belonging to You is 3.
>> heads.
head.
my score belonging to I is 5.
I am the winner.
You are the loser.
>> am i the winner?
no.
You are not the winner.
>> how was your score when my score was 2?
score was 4.
score was 3.
score was 2.
>> what value was my score when your score was 4?
your score belonging to You is 3.
your score was 2.
```

The statement "if my score is 5 then i am the winner and you are the loser" is an explicit inference. When conditions match, the inference executes and causes side-effects like "you are the loser."

I avoided asking "what was my/your score..." Why? Because the questions would have been taken literally and the answer would have been something like "your score is a measurement." Everyday language is replete with idiomatic expressions. This would be an example of a mild idiom. Brainhat has a facility for rewriting idioms. But, are we trying to create a chat bot? No.