Skip to content

Instantly share code, notes, and snippets.

@ikuwow
Created June 13, 2016 07:21
Show Gist options
  • Select an option

  • Save ikuwow/c3ba2f87afcf8cb8fdb89e68d9c341d7 to your computer and use it in GitHub Desktop.

Select an option

Save ikuwow/c3ba2f87afcf8cb8fdb89e68d9c341d7 to your computer and use it in GitHub Desktop.
this_is_teratail2.php
<?php
/**
* teratail
*
* by Leverages Co. Ltd. Technology Media Lab
*/
function teratail(AwesomeEngineer $you) {
if (!isset($you->problems)) {
return "I am always happy.";
}
$question = new Question($you->problems);
$you->postQuestion($question);
while (!$question->resolved) {
$you->wait_for_answers();
$answers = $you->getAnsweres();
if (!is_null($answers)) {
if ($you->resolveQuestions($answers)) {
$you->question->resolved = true;
$you->appreciate("Thank you!");
break;
}
}
}
return ($engineer->evolve());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment