8

boolean experience = false;
boolean get_a_job;

while(!experience){

get_a_job = false;

while(!get_a_job){

experience = false;

while(!experience){

get_a_job = false;

.....

«To infinity and beyond!»

Comments
  • 2
    All you have to do is "break;" out of this devil loop xD
  • 3
    Use recursion, my friend, ffs use recursion!
  • 0
    @Kalex Been there, done that. 😥
  • 2
    bool experience = false;
    bool job = false;

    void getJob () {
    if (!experience)
    inc_experience();
    else
    job = true;
    }

    void inc_experience () {
    if (job)
    experience = true;
    else
    getJob();
    }
  • 0
    @akashvartak hahaha yes, solution to this problem given below

    boolean do_freelancing;

    while(!get_a_job)
    {
    do_freelancing = true;
    if(do_freelancing)
    experience =true;
    if(experience) break;
    }
  • 2
    Sorry, I could not sleep thinking about this. Here's the recursive version. Syntax needs fixing, but at least the algorithm makes sense...

    boolean hasJob = false;
    boolean hasExperience = false;

    void getJob() {
    while (!hasJob) {
    gainExperience();
    }
    }

    void gainExperience() {
    while (!hasExperience) {
    getJob();
    }
    }

    void main() {
    getJob();
    }
  • 0
    @kalex kaam nahi aahe ka aaj? 😂😂
  • 1
    @akashvartak 79 build in progress 😅😅
Add Comment