3 ms·
Is this an original joke/impression by GPT-4? Either way, this is hilarious.
by bqmjjx0kac 4y ago
Is this an original joke/impression by GPT-4? Either way, this is hilarious.
- localhost 4y agoI copied the response verbatim. I also did a follow-up where it wrote the interpreter as well: class KimmieInterpreter: def __init__(self): self.variables = {} def interpret(self, code): for line in code.split("\n"): tokens = line.split() if len(tokens) == 0: continue if tokens[0] == "#": self.variables[tokens[1]] = None elif tokens[0] == "#my_var": self.variables[tokens[1]] = int(tokens[3]) elif tokens[0] == "OMG": print(tokens[1][1:-1]) elif tokens[0] == "add": var1 = self.variables[tokens[2]] var2 = self.variables[tokens[3]] result = var1 + var2 self.variables[tokens[1]] = result