Lets do some programming!

I have been learning how to do a bit of programming recently and it is starting to effect the way that I look things. For instance, I am enjoying reading Ursula Guin’s ‘Left Hand Of Darkness’ and I stumbled across a quote of hers that seemed to translate into a type of conditional loop. Huzzah! An opportunity to throw something of a small program together…

let whatNext = (action, info) => {
let profitable = 0;
// check input for nonsense
if(action && info){
profitable++;
return "your a wizard on top form!"
}else if(action && !info){
profitable++;
return "action is required"
}
// this is the heart of the quote...
do{
if(!action && info){
profitable++;
return "gather information";

}else if( !action && !info ) {
profitable++;
return "sleep";
}
}while(profitable);
};

Yes I know, there really is no need for the while loop! And the ux leaves everything to be desired. It does though get something of the spirit of the quote across… can you have a guess at what the quote might be?

This post is tagged with: