top | item 37078280

(no title)

sgslo | 2 years ago

I ran the 'create a snake' game example using the paper's source at https://github.com/geekan/MetaGPT

The creation process used 11,940 tokens on input and 2,993 tokens on output, which cost $0.35 and $0.18, respectively.

The game it generated consisted of four python classes in four separate files: Main, Game, Snake, and Food.

The game executed without error on the first try, but the snake wasn't able to 'eat' the food. Here's the relevant code for 'eating' food:

    # Check if the snake ate the food
    if self.snake.body[0] == self.food.position:
        self.score += 1
        self.snake.grow()
        self.food.generate()
The issue was that the snake's body was represented as a list of lists, whereas the food position was stored in a tuple. After changing the food position to a list, the game worked correctly.

discuss

order

33a|2 years ago

For comparison, I asked ChatGPT to build one and here's what I got in one shot:

https://chat.openai.com/share/b4b399ef-1def-4f68-b2f1-8c56ca...

Seems to work correctly, didn't have to change anything in the code.

Like all the other agenty stuff I've seen it's not clear what the fluff adds over just prompting the base model.

kosh2|2 years ago

Maybe simply a larger task?

"Write 10 popular mini games"

--> What are those games? 1. Agent --> How does each of them work? 2. Agent --> Write each of those. Agent 3-13

reedf1|2 years ago

Which positions did you "hire"? Would be interested to see if that changes the robustness of the output. Same goes for "investment".