The first guess is hardcoded (use 5 different goods). From then on all combinations are precalculated in a simulation (takes up to 13 hours depending on the number of goods even with a 9900K and 16 threads). The results are stored in a table. The extension just looks up the best guess depending on which combination of red/green/yellow have been received.