note / learning note

Early game-code sketches

Three generated game sketches moved from a console character to an SDL rectangle and a rough C++ room-and-combat model.

I began by asking for a simple side-scroller in C. The first generated example put a P in a 20-by-10 console grid and moved it to the right until it wrapped around. I then asked for graphics, and the answer became an SDL window with a white rectangle I could move left and right. Those were two very different meanings of “game,” and neither yet included a scrolling world.

The last jump was to a more ambitious C++ room-and-combat sketch. It had a player, rooms, an enemy, and choices, but reading the types exposed connections that would not line up as written. I had not reported compiling any of these drafts. The sequence is still useful because it shows the gap between asking for a game, getting a plausible code sample, and finding the exact mechanics or interfaces that would make it playable.

A character crossing the console

The first example used a 20-by-10 character grid. A P started at column 2 halfway down the screen; every update moved it one column right and wrapped it back to zero at the edge:

void updateGame() {
    playerX++;
    if (playerX >= WIDTH) {
        playerX = 0;
    }
}

Drawing cleared the console and printed dots everywhere except the player’s position. The only input was q to quit. It used conio.h, _kbhit(), _getch(), and system("cls"), so the generated example was tied to particular console environments. A busy loop provided its delay. Despite the side-scroller label, it was a moving character in a fixed grid, with no camera, obstacles, or jump mechanic.

A white rectangle in SDL

The graphical sketch created an 800-by-600 SDL2 window with a 50-by-50 white rectangle on black. Left and right arrow keys changed its horizontal position by five pixels; Escape or closing the window exited. The program was divided into initialization, input, update, rendering, and cleanup functions.

The update function was still a placeholder. Background scrolling, collisions, level geometry, and scoring were suggestions for future work rather than features in the code. It demonstrated a window and a movable rectangle, which is a smaller and more concrete starting point than the title implies.

A rough text RPG

The C++ response introduced Player, GameElement, Room, Enemy, and Game. It proposed three connected rooms—a dark room, a dusty library, and a laboratory—and a goblin encounter with attack or flee choices. Player health started at 100, while the goblin was constructed with 30 health.

Reading the sketch also exposes unfinished interfaces. Room::addConnection accepts a Room*, but the constructor tries to pass it an Enemy*. The game calls getConnections() even though the shown Room class does not define it. Game also contains a Player member without supplying the constructor argument that Player requires.

I ended with three very different generated starting points and a better sense of their gaps: movement without a scrolling world, a graphics window without a level, and a room game whose types did not yet fit together. I had not reported compiling any of them.

Related rabbit holes

PublishedOct 3, 2026
note / experiment

A thin-client Linux experiment

A network-boot question became a comparison of separate remote desktops and shared physical desktops, ending with a usable Linux thin-client session and working audio.

Documented activity: September 20, 2026 – September 26, 2026