Skip to content

Instantly share code, notes, and snippets.

@scottlingran
Last active June 14, 2024 08:09
Show Gist options
  • Save scottlingran/cdd69d7d9e898c36bb8c878c2c4b19a8 to your computer and use it in GitHub Desktop.
Save scottlingran/cdd69d7d9e898c36bb8c878c2c4b19a8 to your computer and use it in GitHub Desktop.
The Liar paradox is not so paradoxical if seen as an automata.
class Automata {
constructor() {
this.sentence = false;
}
run() {
while (true) {
console.log(`This sentence is ${this.sentence}.`);
if (this.sentence === false) {
this.sentence = true;
} else if (this.sentence === true) {
this.sentence = false;
}
}
}
}
(function main() {
const automata = new Automata();
automata.run();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment