I once wrote a boolToInt
int boolToInt(boolean bool){ if(bool){ return 1; else{ return 0; } }
Not proud. It was my first year
Ah, I see the problem -- you should have used a ternary operator!
It should use an IntegerFactory.
Slaps forehead. Of course! Better make it Abstract, just to be sure.
That is ugly indeed. What were you even doing there?
Here, I corrected your code
int boolToInt(boolean bool){ if(bool===true && bool!==false){ return 1; else{ return 0; } }
10/10, I'd include it in every file of a project for the enjoyment of those reading my code.
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 once wrote a boolToInt
Not proud. It was my first year
Ah, I see the problem -- you should have used a ternary operator!
It should use an IntegerFactory.
Slaps forehead. Of course! Better make it Abstract, just to be sure.
That is ugly indeed. What were you even doing there?
Here, I corrected your code
10/10, I'd include it in every file of a project for the enjoyment of those reading my code.