Mathrix
MindPhair Puzzle
NEWJob Description
Apply
Join talent pool
1h ago
Get a chance to win a BBQ!
Join the Mathrix MindPhair puzzle competition for your chance to win an Kamado 13 BBQ. At Mathrix, we love a good challenge, and we’re inviting you to take part in this fun competition. Ready to put your skills to the test? Submit your answer as .py file before the 8th of April and if you have any questions, feel free to reach out to us at recruitment@mathrix.com.
The winner will be announced after April 15th. Good luck!
Mathrix Challenge 2026: Foosball
Introduction
After a day of work, we like to unwind with a game of foosball at Mathrix. But we should not forget our computers — they also deserve some leisure time! That is why we created a foosball game especially for them. Can you help us by writing instructions for the computer to follow? Write a Python function that determines the movements of your players and, if applicable, the ball. Your function must produce its output within 0.01 seconds. You may use only the following libraries: numpy, time, and matplotlib.
Concretely, your function must return an instance of the class StrategyOutput, which has two members: coords and state.
The member coords is a numpy array where coords[i] specifies:
• the new position of player i on your team, if player i does not possess the ball; or
• the ball's shooting target, if player i possesses the ball.
The member state may be any Python object of your choice. It will be passed back to your function on the next call, allowing you to retain information across iterations (e.g., previous game states) and adapt your strategy over time.
Rules
Game Overview
The game is played between two teams: Team 0 and Team 1.
The match takes place on a rectangular football pitch of 100 meters (length) by 50 meters (width). The pitch boundaries are defined as follows:
• The left boundary corresponds to Team 1's goal.
• The right boundary corresponds to Team 0's goal.
• The top and bottom boundaries are sidelines.
Each team has five players, and there is one ball on the field.
Objective
• If the ball crosses the right boundary, Team 0 scores (increasing their score by 1) and Team 1 takes the next kick-off.
• If the ball crosses the left boundary, Team 1 scores (increasing their score by 1) and Team 0 takes the next kick-off.
• A team’s score is also increased by 1 immediately if the opposing team makes an invalid move.
The game proceeds in discrete iterations until 1000 iterations have been performed.
Game Iteration
Each iteration consists of the following steps:
Both teams receive the current game state.
Simultaneously, both teams submit their strategy outputs.
Player movements are executed first.
If applicable, the ball is then shot.
If the number of iterations is below 1000, the next iteration begins.
Ball Possession and Movement Rules
Player Movement
• Each player moves according to their team's strategy.
• If a player possesses the ball, that player does not move during the movement phase.
• After all players have moved, ball-related actions are resolved.
Gaining Possession
If no player currently possesses the ball:
• A player gains possession if they move within 1 meter of the ball.
• If multiple players reach the ball in the same iteration, the player who required the least movement distance to reach it gains possession.
Shooting the Ball
If a player possesses the ball:
• The player must shoot the ball.
• The ball travels along the specified trajectory.
• The ball may be intercepted by another player.
Interception
A player intercepts the ball if, after moving, their distance to the ball's trajectory is at most 1 meter.
Strategy Constraints
All strategies submitted by the teams must satisfy the following rules:
Pitch boundaries: All players must remain within the pitch boundaries at all times.
Ball boundaries: The ball must not be shot beyond the top and bottom boundaries of the pitch.
Maximum movement: A player may move at most10 meters per iteration.
Minimum movement (non-possessing players): A player who does not possess the ball must move at least 1 meter per iteration.
Distance constraints before a shot: If a team possesses the ball:
• All other players on the possessing team must remain at least 5 meters away from the ball before it is shot.
• All players on the opposing team must remain at least 4 meters away from the ball before it is shot.
• The player possessing the ball is exempt from these distance constraints.
6. Shot distance: A player who possesses the ball must shoot the ball a distance of at least 3 meters and at most 20 meters.
See here a link for a Python-file for the exact implementation:
https://mathrix.com/mindphair/foosball.py
Submit your answer as .py file before the 8th of April and if you have any questions, feel free to reach out to us at recruitment@mathrix.com. The winner will be announced after April 15th. Good luck!
:
Mathrix
Location: ZG Zug CH
Join talent pool
Receive similar jobs:
email-suggestions#handleInput click@window->email-suggestions#clickOutside" type="email" value="" name="user[email]">
Zug, Switzerland
Cover Letter / AI Interview
⬇
Chat
Write a Cover Letter Start an AI Interview
Please sign-up to start using this chat.
Already signed-up?
Log in.
chat#disableForm keydown->chat#enterPressed" action="/chat" accept-charset="UTF-8" method="post">