Skip to content

Instantly share code, notes, and snippets.

@dchacke
Last active September 24, 2021 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dchacke/d06cb96db9bd29427ae480abc8630f76 to your computer and use it in GitHub Desktop.
Save dchacke/d06cb96db9bd29427ae480abc8630f76 to your computer and use it in GitHub Desktop.
How could a robot respond to pain without being conscious?
let incoming_electric_signal = get_electric_signal();
// The electric signal could represent the temperature of whatever the robot just touched, say.
// The higher the temperature, the greater the number returned by `get_electric_signal`.
// If some threshold is passed:
if (incoming_electric_signal > 1000) {
// Detected pain!
say('OUCH');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment