This project contains a solution for the "Wundertüten" (Surprise Bags) problem from the BWINF42 2023 programming competition.
src/— Java source filesbin/— Compiled classesEingabe_Ausgabe.txt— Input and output file for the program
The program reads the number of surprise bags and the number of different game types from Eingabe_Ausgabe.txt. It then distributes the games as evenly as possible among the bags and writes the result back to the same file.
3
3
4
4
4
- 3 bags
- 3 types of games
- 4 games of each type
The program writes the distribution of games to the file, showing which games are in each bag.
- Make sure you have Java installed.
- Place your input in
Eingabe_Ausgabe.txt. - Compile the Java files in the
srcfolder:javac -d bin src/*.java - Run the main class:
java -cp bin Wundertüten
src/Wundertüten.java: Main class, program entry pointsrc/WundertütenPacker.java: Logic for distributing gamessrc/Wundertüte.java: Represents a single bagsrc/FileReaderx.java: Reads input from filesrc/FileCreator.java: Writes output to file
See LICENSE for details.