7

Here is your homework

 3 years ago
source link: https://thephp.cc/news/2021/01/here-is-your-homework
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
The PHP Consulting Company

Today is the first day of school in 2021 here in Bavaria. Due to the lockdown that we have all over Germany and the homeschooling that comes with it, we have found that it helps to motivate our kids to do their homework when they see us adults work as well. So here is your homework.

Here is your homework

Since most of us have probably watched "The Queen's Gambit", we felt that a Chess challenge would be appropriate.

We would like you to write software that, given a Chess piece and its position on an otherwise empty board, prints all possible moves for that piece. Pick your favourite one: King, Rook, Bishop, Queen, Knight, or Pawn.

Not challenging enough? Then expand your solution so that it also works for non-empty boards. Note that the respective rules for capturing need to be taken into account. For the purposes of this exercise, we do not care whether the board state can be reached through actual play.

Your solution does not need to be complete, but what you send us has to work. Text output on the CLI is good enough for us. Automated tests are optional, but welcome.

Why, you may wonder, should you do this homework? Fair question.

We invite you to email your solution as an archive to [email protected] by Friday, January 15, 2021 12:00 PM (CET). We will review all solutions we receive and discuss selected examples in our code review session at The Online PHP Conference, completely anonymous and in a constructive fashion.

Of course, you will need to purchase a ticket for the conference to participate in the code review session. But we will make sure that the whole conference will be worthwhile.

Share this article:

Welcome to The PHP Consulting Company (thePHP.cc). We are leading experts on software development, specifically using PHP and related technologies.

You can find us on Twitter, LinkedIn, and XING.

We speak at conferences, offer best-in-breed training, publish seminal articles, and are available for consulting.

About the authors

Sebastian Bergmann is the author of PHPUnit and sets the industry standard of quality assurance.

Arne Blankerts has solutions ready before others have even understood the problem.

Stefan Priebsch inspires with a combination of new ideas and field-tested approaches.

How to get in touch with us:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK