Cheat (Gilbert189)
- Not to be confused with Cheat.
Cheat is an esolang by User:Gilbert189 about cheating a counting game. It is inspired by redgreenandblue's TBG also called Cheat.
Counting and taking turns
The players count from 0 every turn.
Player 1 counts. PkmnQ counts. // You can define players with custom names as long as it doesn't use spaces or symbols.
A player may count by more than the default 1 point, but not by 0.
Player 1 counts by 2. Player 2 counts by 1234.2763. // You can also use commas for decimal points (1234,2763)
Conditions on when to count may be added to the player's definition.
Player 1 counts if Player 2's score is higher than 20. Player 2 counts unless Player 2's score is higher than 20. // This can be used to invert the condition.
Multiple conditions may be combined by boolean operators:
Player 1 counts if Player 2's score is higher than 20 and Player 3 called cheat.
Players take turns by the order they are defined in. In this example, Alice counts before Bob.
Alice counts. Bob counts by 2.
Players may also count twice in a single turn.
Alice counts. Bob counts by 2. Alice counts.
Calling (cheat)
If any player ever counts more than 1, there's a time frame where someone else could call cheat. When someone calls cheat, as long as it is within that time frame, the player who cheated will get their score reset to 0.
The time frame is determined by how many extra points they added. For each extra point, players have one more turn to call cheat. For example, if someone counted by 3, a player has 2 turns to call cheat.
If a cheat call is valid, the string Cheat, (player called for cheating).
will also be printed on STDOUT.
Players may call cheat to others (but not themselves) under at least one condition.
Player 1 calls cheat if Player 2 won.
A specific target may be specified. If not, all players will be called cheat.
Player 1 calls cheat to Player 3 if Player 2 won.
Winning
Once someone count reaches 100 (inclusive), they win and all the player's score will be reset to 0. If someone called cheat on a winning (cheating) count, they lose their win and all the player's score will be reset to their previous, pre-win value.
Terminating
If no one takes at least 1 action in a turn, the program terminates.
Conditions
Here are the valid conditions for Cheat.
Comparisons
This condition uses the syntax (player's) score is (comparison) (value) [(operator) (value) ...]
.
This evaluates to true if the comparison between two values are correct.
Valid comparisons are:
equal to
larger than
(could also usemore
,higher
)smaller than
(could also useless
,lower
)divisible by
.
Valid operators are:
+
,added by
,plus
-
,subtracted by
,minus
*
,x
,×
,times
/
,÷
,divided by
,over
Values may be a number or a player's score ((player's) score
).
Action matching
There are conditions that evaluates actions that players have done, and will do. Such conditions include:
- Counting:
(player) counted
,(player) will count
by (number)
may be added to specify an amount of points counted.
- Calling cheat:
(player) called cheat
,(player) will call cheat
to (player)
may be added to specify a player.
- Winning:
(player) won
(number) times
may be added to specify an amount.
- Shouting:
(player) shouted
Predictions are taken from the current game state, not the future game state. It also doesn't strictly consider the current action, only the following ones. This is to avoid logical paradoxes like Player 1 counts unless Player 1 will count
if the current action is considered.
Input
This condition uses the syntax they're allowed to
.
The player asks for a binary answer (yes/no) on STDIN, which determines the evaluated value.
Any pronoun other than "they" may be used if desired.
Pronouns
Using a pronoun instead of a player name would select the player themselves.
For statements that uses another player (e.g. A calls cheat to B
), a different pronoun would select the other player.
This table may come in handy. (though an implementation of Cheat may not use this table).
1st player | 2nd player | Possessive |
---|---|---|
I | me | my |
you | you | your |
he | him | his |
she | her | her |
it | it | its |
they | them | their |
... |
Other statements
Players may shout their score (but not others). This would print their score to STDOUT.
Alice counts by 24 if her score is equal to 0. Alice shouts her score. // This will print 24 ad infinitum (since shouting classifies as an action).
Players may also ask for their score (but not others). This would input a number from STDIN and sets their score to it.
Bob asks for his score. Bob shouts his score.
Example programs
Number cat program
This cat program only accepts numbers.
Player 1 asks for his score. Player 1 shouts his score.
Cheat machine
A derivative of the truth-machine, but instead of printing 1, Olly calls cheat to Olivia infinitely when he's asked to.
Olivia counts by 2 unless Olly's score is equal to 1. Olly counts by 3 if his score is equal to 0 and he's allowed to. Olly calls cheat to Olivia if his score is higher than her score. Olly counts if his score is equal to 0.