Demo application (tic-tac-toe game and more) built with Web Components, with progressive enhancement / graceful degradation.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Inga 🏳‍🌈 36e4dc544a minor cleanup of package.json 1 month ago
src do not crash on large boards, fall back to manual play 1 month ago
.gitignore initial npm project structure, linting / ts 1 month ago
.prettierrc improved formatting (line width set to 120) 1 month ago
LICENSE Initial commit 1 month ago
README.md README: time spent 1 month ago
eslint.config.js implemented generic solver tests; extracted tictactoe-specific solver tests to integration tests file 1 month ago
package-lock.json minor cleanup of package.json 1 month ago
package.json minor cleanup of package.json 1 month ago
tsconfig.build.json implemented tictactoe-all ruleset 1 month ago
tsconfig.json unified button logic between backend and frontend 1 month ago

README.md

Assignment

Source: https://www.programmfabrik.de/en/assignment-frontend-backend-developer-job-berlin/

Code a tic-tac-toe game

Depending on the job you are applying for, you can code in Javascript (ECMA) or C++.

Requirements

  • Use your own code only and start from scratch
  • Player can choose the opponent to be human or computer
  • Use [L]GPL'ed libraries if necessary, please include copyright notes
  • Let us know how long it took you to code the game

JavaScript version

  • Implement in Javascript so that it works in Mozilla Firefox
  • Make use of CSS, provide nice visuals
  • Make the back button work

C++ version

  • Implement in C++, so that i works on the command line under Linux
  • The opponent has to be unbeatable

Solution

Time spent

By major chunks of work in git history:

  • ~0.5 hours to set up the project;
  • ~5 hours to implement game board serialization, tic-tac-toe rules and game solver (with tests);
  • ~1 hour to set up the backend / frontend structure with JSX templating and static resources;
  • ~2 hours to implement progressively enhanced form and query string value trackers (both on backend and in web components);
  • ~3 hours to implement basic game UI in client-server mode;
  • ~2 hours to enhance the most basic game UI features on frontend for offline mode;
  • ~2 hours to make UI fully functional, to cleanup the code and reduce duplication between frontend and backend, and to make the resulting page somewhat presentable
  • ~2 hours to implement another set of tic-tac-toe rules (with tests), support for changing board size (both on backend and in web components).

...which makes it ~18 hours total. I definitely did not expect to spend that much; but also originally I didn't think that the scope will expand this much.