Member-only story
Coding Classic Arcade Game with Claude of Anthropic fame
Can Claude Build PacMan

I had just got Claude to write the bare bones needed to create “Space Invaders” and wondered if Claude could do something more challenging. PacMan came to mind. Claude would have to build a maze, have multiple independent moving sprites and give me some means of interacting with it.
I cut to the chase and asked the question.

Claude disappeared for a few moments and came back with a very impressive first draft. It was remarkable because everything worked. I asked Claude to make the maze a little more challenging and add sound effects; he did so without missing a beat. This is his code in React.
import React, { useState, useEffect, useCallback, useRef } from 'react';
const GRID_SIZE = 28;
const CELL_SIZE = 15;
// Sound generator functions using Web Audio API
const createAudioContext = () => {
const audioContext = new (window.AudioContext || window.webkitAudioContext)();
const createWakka = () => {
const oscillator = audioContext.createOscillator();
const gainNode = audioContext.createGain();
oscillator.connect(gainNode)…