Instructions for the trainee task (Kniffel)

Download Kniffel 2025

A. Please continue the development of the default Kniffel game.

The preset already offers you the following functionalities:

  1. Roll the dice: Each of the five dice shows a random number between 1 and 6 (written in the attribute "value").
  2. Hold dice: Click on a dice to hold or release it (is labelled in the "data-hold" attribute).
  3. The current dice can be assigned to ones and twos (click on the respective points field).
  4. The total number of points is increased.

The following functionalities are missing or need to be extended. Please note all "@TODO" comments in kniffel.html, script.js and style.css.

  1. If a dice is held, it must not be rolled when you click on the "Dice" button.
  2. If a point field has already been selected, e.g. ones, you may not assign points here again.
  3. A maximum of three throws are allowed per round. The dice must now be assigned to a free point field at the latest.
  4. Centre the "Dice" button.
  5. Merge the frames of the table cells and the table (the visible spaces between the cells disappear).
  6. Expand the value table and functionality so that threes, fours, fives and sixes can also be selected.
  7. Prevent the dice from being held or released before they have been rolled at least once.
  8. Reset the number of throws made when a round has been completed.
  9. Calculate a triple and quadruple.
  10. When the dice are assigned to a point field, show in a freely selectable form which five dice values are used at this point in time so that it is possible to see at any time which five dice values were used at the time of assignment for triple doubles, for example.
    All you need to do here is display the five dice values next to the score or display them in the console.

If you have completed an apprenticeship or higher in the field of application development or have many years of practical experience, you will also be given the following additional tasks:

11. calculate a full house.
12. calculate a small and large road.
13. calculate a trick and a chance.
14. if the total score of all points entered from ones to sixes is at least 63, then you receive 35 bonus points.
15. determine that the game is finished (all point fields have been placed) and visualise this state.

IMPORTANT: If you are eligible for the 5 additional tasks, the first 10 tasks are compulsory.

B. You are of course allowed to add further HTML elements, styles and Javascript variables or functions or to change existing ones.

You are also allowed to try to complete the game completely if you find the task too easy or a lot of fun!

Further possibilities are

  1. Expand value table and calculate points for: Full House, Small Street, Big Street, Yahtzee, Chance.
  2. If the total sum of the points entered for ones to sixes is at least 63, you receive 35 bonus points.

You can find a working Kniffel demo at the following URL (only serves to illustrate and understand the game):

https://onlinespiele.schmidtspiele.de/?/home

C. If you are not familiar with HTML, CSS or Javascript constructs, you can find information about them on the Internet, for example. We recommend

http://www.w3schools.com

D. Other editing and application information.

  1. Open kniffel.html in any browser to start the game.
  2. Use any text editor to make changes to the files kniffel.html, script.js and style.css. We recommend
    https://notepad-plus-plus.org/
  3. You can use the F12 key in most modern browsers to open the development console, making it easier to test and try things out.
  4. The comments in kniffel.html, script.js and style.css should help you to understand the relevant lines.
  5. Completion of the game is not mandatory!

If you get to a point where you can't make any further progress, simply send us your latest version.

E. Support from third parties or artificial intelligence (AI).

In principle, we welcome it if you accept help from other people or even AI (e.g. ChatGPT) in solving this task.

  • However, please note that the purpose of this task is to convince us of your skills in working with HTML, CSS, JavaScript and in general solving logical problems and your creativity.
  • If you are invited for an internship, your Kniffel solution will be checked together with one of our specialists and your understanding of the solution applied will be tested.
  • We therefore recommend that you make sure you understand the solution used when receiving help from other people or AI.

We wish you lots of fun and success with this task!

Your EGOTEC AG Team