TransWikia.com

a neural network for text based games

Data Science Asked by user109082 on January 2, 2021

How can I use a neural network for this example? I have already tried perceptron , but I would like to see something else, something that can be supplemented in the future. The example is cropped.

how can you use the data that the neural network should get: people, money, food
I need to make the neural network itself by trial and error clicking on these actions, found the ideal option for getting the maximum number of people(either money or points for each action that comes to mind) how can this be implemented?

import random


class game:
    def __init__(self):
        self.people = 100
        self.gold = 0
        self.food = 1000

    def One_Action(self):
        
        self.people += round(self.people/100) + random.randint(0, self.gold // 2)
        self.gold -= self.people // 2 + self.food // 2

        if self.gold <= 0:
            game.Lose(self)
        print(self.people)

    def Two_Action(self):
        self.gold += self.people // 2 + self.food
        self.food -= (self.people / 100) * 50

        if self.food <= 0:
            game.Lose(self)

    def Three_Action(self):
        self.food += self.people // 3 * random.randint(2,5)
        self.people -= self.people / 100 * random.randint(1,3)
        self.gold -= self.people / 100 * random.randint(1,3)

    def Lose(self):
        print(f"Max People: {self.people}")


```

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP