Created
February 21, 2015 12:39
-
-
Save kn9ts/b02c0d0fdac3d0a000bf to your computer and use it in GitHub Desktop.
Friends do not mistreat friends algorithmn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
*@Author - Eugene Mutai | |
*@Twitter - Jheneknights | |
*@Email - eugenemutai@gmail.com | |
* | |
* Date: 21/03/14 | |
* Time: 2:00 pm | |
* | |
*/ | |
// Friends do not mistreat friends | |
(function ifMistreated(friend, option) { | |
// If there is a choice to walk away | |
if (options.walkaway !== null) { | |
// embrace the pain and walk away | |
_.actionDo('embraceThePain', options.strong, function(results) { | |
results.walkedaway = true; | |
}); | |
} else { | |
// Else if you need to let them know it is unacceptable and you got hurt | |
options.valueYourself(true, function setBounderies() { | |
// Yes, it was wrong to mistreat me | |
if (typeof options.setBounderies == "function") { | |
// Bring it up | |
var do_this = _.actionDo('bring it up', function state() { | |
// And state that it was wrong | |
var statement = {"stated": "It was wrong to mistreat me."}; | |
return statement; | |
}); | |
// Forgive him or her | |
if (do_this) options.setBounderies("isForgiven", true); | |
} | |
}) | |
} | |
})("Friend", {walkaway: null, strong: true, setBounderies: true}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment