Update README.md#11
Open
yanisann11 wants to merge 1 commit into
Open
Conversation
# Импорты
import numpy as np
import random
from enum import Enum
# 1. Генерация планеты
class Planet:
def __init__(self, seed=42):
self.seed = seed
self.resources = {"металлы": 1e6, "вода": 5e6, "органика": 2e6}
self.biomes = self.generate_biomes()
def generate_biomes(self):
# Процедурная генерация биомов (упрощённо)
return np.random.choice(["лес", "пустыня", "океан", "горы"], size=(100, 100))
# 2. ДНК и существа
class DNA:
def __init__(self, genes=None):
self.genes = genes if genes else {"intelligence": 0.1, "curiosity": 0.5, "strength": 0.3}
class Creature:
def __init__(self, dna=DNA()):
self.dna = dna
self.energy = 100
self.skills = {"toolmaking": 0.0}
# 3. Нейросетевой интеллект
class NeuralBrain:
def __init__(self, input_size=5, hidden_size=10):
self.weights = np.random.randn(input_size, hidden_size)
def forward(self, inputs):
return np.dot(inputs, self.weights)
# 4. Цивилизация и эпохи
class Era(Enum):
TRIBAL = 1
INDUSTRIAL = 2
DIGITAL = 3
SPACE = 4
class Civilization:
def __init__(self):
self.tech_level = 0
self.era = Era.TRIBAL
self.inventions = []
def evolve(self, planet):
if self.tech_level > 10 and planet.resources["металлы"] > 1000:
self.era = Era.INDUSTRIAL
self.inventions.append("паровая_машина")
# 5. Космическая экспансия
class SpaceExpansion:
def __init__(self, civ):
self.civ = civ
self.colonies = []
def launch_colony_ship(self):
if self.civ.tech_level >= 20:
self.colonies.append("alpha_centauri")
# 6. Мета-эволюция
class MetaEvolution:
def optimize_curiosity(self, civ):
if civ.tech_level < 5:
civ.dna.genes["curiosity"] *= 1.05
# 7. Глобальный симулятор
class GalaxySimulator:
def __init__(self):
self.planet = Planet()
self.civ = Civilization()
self.year = 0
def run(self, years=1000):
for _ in range(years):
self.year += 1
self.civ.evolve(self.planet)
if self.year == 500:
self.civ.era = Era.DIGITAL
elif self.year == 800:
SpaceExpansion(self.civ).launch_colony_ship()
# Запуск
sim = GalaxySimulator()
sim.run(1000)
print(f"Итоговая эра: {sim.civ.era}")
print(f"Изобретения: {sim.civ.inventions}")
mehdimirzaeeofficcial-cyber
approved these changes
Dec 29, 2025
napihayu-svg
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Импорты
import numpy as np
import random
from enum import Enum
1. Генерация планеты
class Planet:
def init(self, seed=42):
self.seed = seed
self.resources = {"металлы": 1e6, "вода": 5e6, "органика": 2e6}
self.biomes = self.generate_biomes()
2. ДНК и существа
class DNA:
def init(self, genes=None):
self.genes = genes if genes else {"intelligence": 0.1, "curiosity": 0.5, "strength": 0.3}
class Creature:
def init(self, dna=DNA()):
self.dna = dna
self.energy = 100
self.skills = {"toolmaking": 0.0}
3. Нейросетевой интеллект
class NeuralBrain:
def init(self, input_size=5, hidden_size=10):
self.weights = np.random.randn(input_size, hidden_size)
4. Цивилизация и эпохи
class Era(Enum):
TRIBAL = 1
INDUSTRIAL = 2
DIGITAL = 3
SPACE = 4
class Civilization:
def init(self):
self.tech_level = 0
self.era = Era.TRIBAL
self.inventions = []
5. Космическая экспансия
class SpaceExpansion:
def init(self, civ):
self.civ = civ
self.colonies = []
6. Мета-эволюция
class MetaEvolution:
def optimize_curiosity(self, civ):
if civ.tech_level < 5:
civ.dna.genes["curiosity"] *= 1.05
7. Глобальный симулятор
class GalaxySimulator:
def init(self):
self.planet = Planet()
self.civ = Civilization()
self.year = 0
Запуск
sim = GalaxySimulator()
sim.run(1000)
print(f"Итоговая эра: {sim.civ.era}")
print(f"Изобретения: {sim.civ.inventions}")