I've had success getting it to evaluate FizzBuzz, but to do so I told it to write out the state of the program one timestep at a time.
https://chat.openai.com/share/c109e946-fb6d-494e-8182-fc93d2...
...this is actually 3.5. 4 wouldn't need as much explanation.
I wonder how gpt handles code where multiple objects of the same class call the same methods and each individual object calls the same methods with different threads as well as method local variables, class member variables, and static member variables are all in play. [Being fair to our LLM brethren; us meat sacks are sure to hate that hypothetical code as well.]
class X {
private static int _staticCount = 0;
private int _memberCount = 0;
public uint Stuff(int input) {
if (input <= 0) {
return (uint)(_staticCount + 1);
}
var y = new Thread(() => {
Interlocked.Add(ref X._staticCount, (int)Stuff(input - 1));
Interlocked.Add(ref _memberCount, (int)Stuff(input - 2));
});
y.Start();
y.Join();
return (uint)(Stuff(input - 1) + _memberCount);
}
}
class Program {
public static void Main() {
var x = new X();
var y = new X();
var z = new X();
uint resultX = x.Stuff(4);
uint resultY = y.Stuff(3);
uint resultZ = z.Stuff(2);
Console.WriteLine(resultX + resultY + resultZ);
}
}
EDIT: Probably should have setup another way to wait for the threads to end, that way all three X classes could be running at the same time. But perhaps this is a good enough start point.I get 3274511360 when I run it. Although, I had to upgrade everything to uint because I was getting some overflow ... so there might be some of that in the output.
Between the hype and decades of indoctrination through science fiction about how AI is "supposed" to work, I guess it isn't surprising that this is how things are shaking out. People will learn, the way they learned with the internet, but it will take a few years I think.