fungi-slot.js
// Proper mode of population - requires data about population conditions
Proper mode of population - requires data about population conditions
Proper mode of population - requires data about population conditions
populateRandom (mushroomTable, tresholdTable, frequencySum) {
    let seed = Math.random() * frequencySum
    this.type = null
    this.stage = null
    for (let treshold of tresholdTable) {
      if (treshold > seed) {
        this.type = mushroomTable[tresholdTable.indexOf(treshold)].name
        this.type == 'rock' ? this.stage = 3 : this.stage = 1
        return
      }
    }
  }
populateRandom ( mushroomTable , tresholdTable , frequencySum ) { let seed = Math . random ( ) * frequencySum this . type = null this . stage = null for ( let treshold of tresholdTable ) { if ( treshold > seed ) { this . type = mushroomTable [ tresholdTable . indexOf ( treshold ) ] . name this . type == 'rock' ? this . stage = 3 : this . stage = 1 return } } }
Proper mode of population - requires data about population conditions
Proper mode of population - requires data about population conditions