Skip to content

Instantly share code, notes, and snippets.

@dchacke
Last active September 24, 2021 03:40
Show Gist options
  • Save dchacke/d06cb96db9bd29427ae480abc8630f76 to your computer and use it in GitHub Desktop.
Save dchacke/d06cb96db9bd29427ae480abc8630f76 to your computer and use it in GitHub Desktop.

Revisions

  1. Dennis Hackethal revised this gist Sep 24, 2021. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions robot_pain_response.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,9 @@
    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');
  2. Dennis Hackethal created this gist Sep 24, 2021.
    6 changes: 6 additions & 0 deletions robot_pain_response.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    let incoming_electric_signal = get_electric_signal();

    if (incoming_electric_signal > 1000) {
    // Detected pain!
    say('OUCH');
    }