This is my test assignment for an internship position as a React Native dev in Stormotion. I used React with TypeScript and Vite to build this project. HeadlessUI's Transition and react-icons are used in some parts of the codebase, but the whole UI and its components are custom.
be sure to edit vite.config.ts
appropriately:
export default defineConfig({
plugins: [react()],
- base: '/match-game/',
})
After that you're free to run
npm run dev
- development runtimenpm run build
- build the projectnpm run preview
- build preview
Two people are playing a game. From the pile of 25 matches, each player takes either 1, 2 or 3 matches on each turn. The game is over once all matches are taken. Whoever has the even amount of matches wins.
Create an app/simulation where users can play against AI. The player goes first.
- You can use any JS framework, or even no framework at all;
- An app should have a user interface (not a command line);
- AI should make decisions based on an optimal strategy (not just picking a random number of matches);
- Give preference to Emoji instead of images;
- Share the result in a form of git repository with us.
- TypeScript;
- React Native or React;
- React Hooks.
These items are optional, but we would love to see them:
- Add a second mode where the first move is made by AI. The user can select the game mode;
- Implement the general solution when there are 2n + 1 matches in the pile and the number of matches allowed to take on each turn is from 1 to m. The user can adjust the parameters n and m.