Weltküche: echte Hauptlieferanten statt Zufall + Einheiten-Fix
- Welt-Zutaten: die 2 tatsächlichen Hauptlieferanten nach Menge (Pfeffer → Vietnam+Brasilien, Kakao → Elfenbeinküste+Ghana) statt log-gewichtetem Zufall, der kleine Produzenten (Sri Lanka, Kambodscha) fast gleich oft zog - Reihenfolge: „beliefert unseren Markt" (eu/global) vor „selten hier" (world-far) - fmtTonnes: „220.000 t/Jahr" statt „220 Tsd t" (kindgerecht, kein SI-Kürzel kt), Mio mit deutschem Dezimalkomma („1,5 Mio t") Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1033,8 +1033,16 @@ function buildTaskFor(ingKey) {
|
||||
const sourcePool = euRelevant.length >= 2 ? euRelevant : allProducers;
|
||||
const climatePossible = (ing.climate_possible || []).filter(c => C[c]);
|
||||
|
||||
// 2 korrekte aus EU-relevanten Producern, weighted-random
|
||||
const correct = weightedSample(sourcePool, Math.min(2, sourcePool.length));
|
||||
// Die 2 tatsächlichen HAUPTLIEFERANTEN — nicht mehr gewürfelt, sondern nach
|
||||
// echter Menge, damit die Antwort logisch nachvollziehbar ist (schwarzer
|
||||
// Pfeffer → Vietnam + Brasilien, nicht Sri Lanka + Kambodscha). Wer unseren
|
||||
// Markt beliefert (eu/global), kommt vor „Big Player, der bei uns selten
|
||||
// ankommt" (world-far); innerhalb einer Stufe zählt die Tonnage.
|
||||
const MARKET_TIER = { 'eu': 0, 'global': 0, 'world-far': 1 };
|
||||
const rankedPool = [...sourcePool].sort((a, b) =>
|
||||
((MARKET_TIER[a.market] ?? 2) - (MARKET_TIER[b.market] ?? 2)) ||
|
||||
(((ing.producers[b.key] || {}).t || 0) - ((ing.producers[a.key] || {}).t || 0)));
|
||||
const correct = rankedPool.slice(0, Math.min(2, rankedPool.length)).map(p => p.key);
|
||||
|
||||
// 2-4 Distraktoren: 1-2 aus climate_possible (für didaktisches Feedback),
|
||||
// Rest aus klar-unmöglichen
|
||||
@@ -1127,8 +1135,8 @@ function loadIngredient(){
|
||||
if(current.idx>=d.ings.length){ finishDish(); return; }
|
||||
const ingKey = d.ings[current.idx];
|
||||
const ing=ingOf(current.idx);
|
||||
// Aufgabe NEU bauen — pro Zutat-Besuch unterschiedliche Korrekt-Auswahl,
|
||||
// damit nicht immer Vietnam+Indien beim Pfeffer kommt.
|
||||
// Aufgabe frisch bauen (Cache leeren). Die Korrekt-Auswahl ist bewusst
|
||||
// deterministisch: Heimat-Regel bzw. echte Hauptlieferanten nach Menge.
|
||||
delete _taskCache[ingKey];
|
||||
const task = buildTaskFor(ingKey);
|
||||
current.found=[]; current.wrongHere=0; current.wrongStreak=0; current.attempted=new Set();
|
||||
@@ -1209,8 +1217,10 @@ function guess(key){
|
||||
/* ====================== ERGEBNIS-KARTEN ====================== */
|
||||
function fmtTonnes(t) {
|
||||
if (!t || t <= 0) return '';
|
||||
if (t >= 1000000) return (t/1000000).toFixed(t >= 10000000 ? 0 : 1).replace('.0','') + ' Mio t/Jahr';
|
||||
if (t >= 10000) return (t/1000).toFixed(0).replace(/\B(?=(\d{3})+(?!\d))/g, '.') + ' Tsd t/Jahr';
|
||||
// Für Sek I lieber die volle Zahl mit Tausenderpunkt (220.000 t) als „220 Tsd t"
|
||||
// oder das SI-Kürzel „kt", das die Altersgruppe nicht kennt. Millionen bleiben
|
||||
// als „Mio t" gut lesbar.
|
||||
if (t >= 1000000) return (t/1000000).toFixed(t >= 10000000 ? 0 : 1).replace('.0','').replace('.', ',') + ' Mio t/Jahr';
|
||||
return t.toLocaleString('de-DE') + ' t/Jahr';
|
||||
}
|
||||
function regionsHTML(keys){
|
||||
|
||||
Reference in New Issue
Block a user