I only see the assignment operator used instead of the equality operator, which tragically also yields the assigned value. What are the other 2?
What mistakes are there in
static bool isCrazyMurderingRobot = false; void interact_with_humans (void) { if (isCrazyMurderingRobot) kill(humans); else be_nice_to(humans); }
'humans' appears to be undefined, and it's either a missing closing } or poor indentation on the else clause.
So I'm surprised this compiled :)
it's either a missing closing } or poor indentation on the else clause
Butt where? :o
static bool isCrazyMurderingRobot = false; void interact_with_humans (void) { if (isCrazyMurderingRobot = true) kill(humans); else be_nice_to(humans); }
Oops, my bad... I managed to insert braces around the clauses in my memory.
I would suggest they never have the kill() function. Just doesn't make sense to give a robot the ability to kill. :)
kill()
What if a criminal, or even a non-human animal is posing a threat to the owner? Shouldn't they kill(perpetrator)?
kill(perpetrator)
They should administerBearMace(animal)
administerBearMace(animal)
Why would an android assistant for grannies contain bear mace? Sounds scary.
Lol well why would an android assistant for grannies kill animals? No one is innocent here
Because the granny is in imminent danger, and it's the best effort it can make with the general purpose mobility functions.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I only see the assignment operator used instead of the equality operator, which tragically also yields the assigned value.
What are the other 2?
What mistakes are there in
'humans' appears to be undefined, and it's either a missing closing } or poor indentation on the else clause.
So I'm surprised this compiled :)
Butt where? :o
Oops, my bad... I managed to insert braces around the clauses in my memory.
I would suggest they never have the
kill()
function. Just doesn't make sense to give a robot the ability to kill. :)What if a criminal, or even a non-human animal is posing a threat to the owner? Shouldn't they
kill(perpetrator)
?They should
administerBearMace(animal)
Why would an android assistant for grannies contain bear mace?
Sounds scary.
Lol well why would an android assistant for grannies kill animals? No one is innocent here
Because the granny is in imminent danger, and it's the best effort it can make with the general purpose mobility functions.