AI Showdown: Building a Sand Simulator with Claude 3.5 Sonnet vs GPT-4o

Ever wondered if AI language models could whip up a cool physics simulation? Our team tested this by challenging Claude 3.5 Sonnet and GPT-4o to create a browser-based sand simulator

AI Showdown: Building a Sand Simulator with Claude 3.5 Sonnet vs GPT-4o
Building a Sand Simulator with Claude 3.5 Sonnet vs GPT-4o

Hey there, tech enthusiasts! Ever wondered if those fancy AI language models could whip up a cool physics simulation? Well, we did too! Our team, packed with folks who've tinkered with all sorts of physics based models and software, decided to put these AIs to the test. We challenged them to create a sand simulator that runs right in your browser. Let’s see the details!

Our Experiment

We picked two AI heavyweights for this showdown:

  • The new kid on the block: Claude 3.5 Sonnet
  • The previous champ: GPT-4o

Here's how we set it up:

1. We gave both AIs the same simple prompt without any prompt engineering hassles:

Prompt Copy Panel
Your task is to create a real-life sand simulator using HTML, CSS, and JS.
- Separate the HTML, CSS, and JS code.
- There should be a wall around the playground (window).
- The playground (window) should be 400x400 pixels.
- The sand particles should be 4x4 pixels.
- The sand particles should roll down, like in real life.
- The sand should pile up at the bottom (ground).
- Add new sand when the left mouse button is held down.

2. We then chatted with each AI for half an hour, trying to get the best simulator possible.

3. At the end, we told both: "Make the simulator as good and appealing as you can!"

The Results

Claude 3.5 Sonnet - The Quick Learner

0:00
/

If Claude 3.5 Sonnet were in your coding class, it would be that student who finishes the assignment before you've even opened your laptop. It gave us a working sand simulator almost immediately. Imagine seeing sand form realistic piles on your screen - that's what we got.

But we didn't stop there. When we asked for water, it delivered. We had to remind it that sand sinks in water (because physics), but it caught on quickly.

The real showstopper? When we asked it to make things appealing with the mentioned last prompt, it added plant particles and gave the whole simulator a fresh look. Talk about exceeding expectations!

GPT-4o - The Steady Worker

0:00
/

GPT-4o put up a good fight, but it needed a bit more guidance. It's like that coding buddy who gets there in the end but needs a few more coffee breaks.

Adding water was a similar story to Sonnet's attempt - at first, the water only flowed one way. Getting the sand to behave naturally underwater was a challenge we couldn't quite crack, but maybe it understands that when sand gets wet it sticks although it never mentioned this behavior in its answer.

When we asked for the final touch-up, GPT-4 gave the simulator a nice visual boost. But here's the catch - add too much sand, and things start to slow down. It's like when your computer fan starts whirring on a hot day.

What This Means for You

If you're into software development or just love seeing what AI can do, here's what you need to know:

  1. Both AIs can write code, but they're not perfect. You'll still need to debug and optimize.
  2. Claude 3.5 Sonnet was faster and needed less hand-holding. If you're looking for quick prototypes, this could be your go-to.
  3. The way you interact with AI matters. Sonnet's user-friendly interface and shorter response time made the whole process smoother.

These AIs are impressive, but they're not replacing human creativity and complex problem-solving skills anytime soon.

Remember, technology is a tool, and it's up to us to decide how to use it.

Please feel free to leave us a message!