Pseudo-Code for a PhD

//   Preamble    //
define interests = ['childhood dreams', 'tips of BA teachers', 'family know-how']
define max_wait_time = 10 days //change accordingly

list_of_possible_supervisors = new list()
list_of_answers = new list()
list_of_universities = new list()
do
   list_of_possible_universities = google(interests)
   for each (list_of_universities as university)
      list_of_possible_supervisors.add(university,interests)
   endfor
   for each (list_of_possible_supervisors as possible_supervisor)
      email(possible_supervisor, interests)
      possible_supervisor.initialise_wait_time()
   endfor
   //do polling of supervisor list
   do
      for each (list_of_possible_supervisors as possible_supervisor)
         feedback = check_email_from(possible_supervisor)
         if exist(feedback)
            redefine interests = change(interests, feedback)
            list_of_answers.add(answer(feedback))
            list_of_possible_supervisors.remove(possible_supervisor)
            if not exist(list_of_universities[possible_supervisor.university()])
               list_of_universities.add(possible_supervisor.university())
            endif
         elseif possible_supervisor.current_wait_time() > max_wait_time
            list_of_possible_supervisors.remove(possible_supervisor)
         endif
      endfor
   while list_of_possible_supervisors.count() > 0
while list_of_universities.count() > 0

//    Aplication phase    //
//Most of it is just for show: we all know at most 1 university answers back
for each list_of_universities as university
   application(university,list_of_answers.from_university(university))
   university.initialise_wait_time()
endfor
//poll each university response
list_of_accepted_letters = new list()
do
   for each list_of_universities as university
      response = check_mail_from(university)
      if exist(response) and response = 'accepted'
         list_of_accepted_letters.add(get_letter(response))
         list_of_universities.remove(university)
      elseif university.current_wait_time() > max_wait_time
         list_of_universities.remove(university)
      endif
   endfor
while list_of_universities.count() > 0
if list_of_accepted_letters.count() == 0
   return 'Failure. No applications accepted. Run again for another try.'
endif

//   Scholarship phase    //
//assuming you have a scholarship, and if you do, it's always just 1
//that you're eligible for
if not family_savings_ok()
   do
      if exists(feedback)
         redefine interests = change(interests, feedback)
      endif
      essay = write_essay(interests)
      [answer, feedback] = apply_to_scholarship (essay, list_of_accepted_letters)
   while answer == 'no'
   define soul = extract_from(interests)
   money = letter_from_scholarship(answer,soul)
   accepted_university = extract_from(feedback)
else
   money = beg_from_parents();
   accepted_university = extract_from(list_of_accepted_letters.random())
endif

//   First year   //
supervisor = meet_supervisor(university.supervisor)
project = remind(supervisor)
list_of_papers_to_read = extract_from(supervisor)
list_of_papers_read = new list()
do
   for each list_of_papers_to_read as paper
      list_of_papers_read.add(read(paper))
      list_of_papers_to_read.remove(paper)
      redefine interests = change(interests, paper)
      redefine project = change(project, interests, paper)
   endfor
   list_of_papers_to_read = send_to_supervisor(supervisor, list_of_papers_read)
while current_time() < 10 months
redefine project = extract_from(list_of_papers_read, project, interests)
first_year_report = write_report(list_of_papers_read,project)
feedback = first_year_viva(first_year_report, supervisor)
if feedback == 'fail'
   return 'Submit for an MPhil.'
endif
first_year_report = rewrite(first_year_report, feedback)

//   Second year   //
list_of_papers_to_write = extract_from(supervisor, first_year_report)
list_of_papers_written = new list()
list_of_publications = new list()
for each list_of_papers_to_write as paper
   list_of_papers_to_read = extract_from(paper)
   list_of_papers_read = new list()
   do
      for each list_of_papers_to_read as paper
         list_of_papers_read.add(read(paper))
         list_of_papers_to_read.remove(paper)
         redefine interests = change(interests, paper)
         redefine project = change(project, interests, paper)
      endfor
      list_of_papers_to_read = send_to_supervisor(supervisor, list_of_papers_read)
   while list_of_papers_to_read.count() > 0
   paper.introduction = extract_from(list_of_papers_read)
   paper.rest = extract_from(project, interests, ass)
   cry()
   journal = find_journal(paper, supervisor, project)
   if exists(journal)
      pray()
      feedback = submit_to(journal,paper)
      if exist(feedback)
         do
            paper = rewrite(paper, feedback)
            feedback = submit_to(journal,paper)
         while current_time() < journal.publishing_date()
         list_of_publications.add(paper)
      endif
   endif
   list_of_papers_written.add(paper)
endfor
second_year_report = write_report(first_year_report,list_of_papers_written,project)
if current_time() < 2 years
   road_trip()
   start_a_band()
   play_world_of_warcraft()
   sleep()
   read(second_year_report)
endif
feedback = second_year_viva(second_year_report, supervisor)
if feedback == 'fail'
   return 'Submit for an MPhil.'
endif
second_year_report = rewrite(second_year_report, feedback)

//   Third year   //
while list_of_publications.count() == 0
   for each list_of_papers_written as paper
      journal = find_journal(paper, supervisor, project)
      if exists(journal)
         pray()
         feedback = submit_to(journal,paper)
         if exist(feedback)
            do
               paper = rewrite(paper, feedback)
               feedback = submit_to(journal,paper)
            while current_time() < journal.publishing_date()
            list_of_publications.add(paper)
         endif
      endif
endwhile
thesis.introduction = extract_from(list_of_papers_read,second_year_report)
thesis.rest = write_thesis(list_of_publications)
feedback = phd_viva(thesis, supervisor, supervisor.external_examiner)
if feedback == 'fail'
   return 'Submit for an MPhil.'
else
   thesis = rewrite(thesis, feedback)
   return 'Congratulations, Dr. You'
endif
If you actually read all the way to here, and found the error in there, you my friend are sick!

1 comment:

Carmen said...

y si leí todo, pero no encontré en error, ¿estoy medio sick?