JavaRush/Courses/Claude Code SELF/The first rewind in practice

The first rewind in practice

Open

1. Building Tetris step by step and experiencing the first rewind

Since there is no longer any need to keep copying folders, Tommy’s inner perfectionist is finally happy: all the games can be put into the gallery — Clicker one, 2048 two, and today Tetris will be added here too. But first it has to be created…

Tommy remembers Alex’s advice: big things are not done in one shot; they are cut into steps. And the first thing he does is not ask “make Tetris in full,” but cut off the first stage. He gives the AI agent exactly one instruction:

Build browser Tetris in the gallery: a well and one falling
  piece that stops at the bottom. No rotations or scoring yet.

Sam spits out the code, and Tetris files appear in the gallery. Somehow suspiciously fast.

Tommy opens the game locally in the browser. The piece hangs at the top — and goes down. Reaches the bottom, stops. The next one falls. It works. “That’s it,” he thinks: this is the very rollback point Alex kept harping on about. A working state you can safely rely on. After that, step by step, each one checked in the browser:

Add piece rotations on keypress.
Make completed lines disappear and the score go up.

He presses an arrow key — the piece rotates. Checked. Builds the bottom row — it blinks and collapses, the score counter ticks upward. Checked. By the end of the day he has a working Tetris, built not in one leap, but step by step, and on each step it stood firm.

And now — the main thing, the reason it was all started. Tetris works, and Tommy deliberately makes a tweak that could kill it:

Add level-based acceleration to Tetris: the higher the score, the faster
  the pieces fall.

Sam spent a couple of minutes changing the code and finally reported that everything was ready.

Tommy opens Tetris in the browser — and the pieces pour down like from a sack, in a heap, past the well, it’s impossible to play. There is no working version. Tommy even gets an eye twitch: “well, there, I killed it.” His finger reaches for the folder by itself — copy it before it’s too late, old habit. And halfway there he freezes. Stop. I have a magic button now. He takes his hand off the mouse and types right into the session:

/rewind

A menu opens — the agent shows the previous checkpoints and asks what exactly to restore:

Restore code and conversation   # roll back both the code and the conversation history
Restore conversation            # roll back only the conversation
Restore code                    # roll back only the changes on disk

He needs to remove the breakage in the code; there’s no reason to touch the conversation. He chooses Restore code. Clicks.

A second passes. Nothing changed? Or maybe it already did.

Tommy switches back to the browser and refreshes.

The piece appears at the top — straight, alone — and goes down. Reaches the bottom. Lines, score — everything is in place. The very working version, before the risky tweak. As if he had never even been there.

Tommy just stares at the falling piece for a couple of seconds. A moment ago it was a total mess — and with one line he erased it like with an eraser. Beautiful.

“I smashed it to pieces,” he says to the screen, “and fixed it with one word. Well hello there, immortality.”

And after that there was no stopping him. Bright neon themes — he piled them on until it made his eyes glaze over. Before he would have grimaced and left it as is, too lazy to redo it. But now — “crashed? what, I’ll sort it out,” /rewind, Restore code, as if it had never happened.

He dove into the piece-rotation logic, overcomplicated it so much that rotation locks up completely — and instead of “well, I killed it” he already has something completely different: “oh, that’s a beautiful break, let me try once more,” /rewind, back to the working version, try another way. Sound, effects, speed balance — he runs them one after another, more and more boldly, deliberately cranks them up to nonsense just to see how they will fly apart. Every failed attempt is erased with one motion — and each one only makes him even more eager.

And he feels something new click inside. Before, every daring change was a bet: it works — great, it doesn’t — sit there and clean it up or lose a good version. That’s why he was cautious, that’s why he kept making folders. And now the experiment has detached from risk. Trying became free. He makes changes he would have been too shy to even say out loud an hour ago — because the cost of a mistake dropped to zero. Not “what if I break it,” but “let’s try it, I’ll rewind it anyway.”

Before: a change is a bet, now: a change is a try. Before, a daring change either worked or you had to clean up by hand or lose a good version — so you’re cautious and copy folders. Now, if it fails, /rewind brings back the working version and you try another way — in a loop; a mistake costs almost nothing, so you try more boldly. The experiment has detached from risk The experiment has detached from risk Before: a change is a bet Daring change Worked? yes Great no Clean up by hand or lose a good version Result: you play it safe and copy folders Now: a change is a try Daring change Worked? yes Great no /rewind Working version Another way Result: you try more boldly A mistake costs almost nothing, so trying isn’t scary

2. Copies are no longer needed

And suddenly Tommy catches sight of that same folder from this morning’s shame — 2048-final, 2048-final2, 2048-final-absolutely-last, the whole ridiculous zoo he got tangled up in this morning. Now they’re just trash: the thing he built them for is handled by one button.

“In the morning this was my crutch,” he says with a snort, selecting them all at once, “and by evening it was a shame nobody saw. Convenient.”

And he drags the whole brood to the trash in one motion, with that special pleasure of crossing the idiot he was yesterday out of his own life. The icons disappear, the screen is clean. He won’t be keeping safety by making a mess anymore — that’s for people who haven’t found the button.

He leans back in the chair, throws his hands behind his head, looks at his cool Tetris, at the empty folder trash bin — and catches one simple word on his lips: invulnerable. Sweet word.

Broken — rewound — as if nothing had ever happened. The fear that had sat there all week like a splinter (“what if I ruin something good”) almost completely dissolved. Pure excitement remained. And Tommy spins this new power around in his head and unleashes it on everything: if I have an undo button, then I am not afraid of anything anymore. Whatever I mess up — I’ll rewind it.

By evening Tommy can’t take it anymore — he brags. He sends Tom2036 a short, proud message: now I have a real button of immortality; break anything — rewind it, and you’re good.

1
Task
Claude Code SELF,  3 level,  4 lecture
Locked
Tetris Requirements 📝
Tetris Requirements 📝
1
Task
Claude Code SELF,  3 level,  4 lecture
Locked
Spec for reworking 2048 🐟
Spec for reworking 2048 🐟
1
Task
Claude Code SELF,  3 level,  4 lecture
Locked
Breakage note: the game fell apart 🚑
Breakage note: the game fell apart 🚑
1
Task
Claude Code SELF,  3 level,  4 lecture
Locked
Your Game Map 🗂️
Your Game Map 🗂️
1
Task
Claude Code SELF,  3 level,  4 lecture
Locked
Build Tetris from the spec 🎮
Build Tetris from the spec 🎮
1
Task
Claude Code SELF,  3 level,  4 lecture
Locked
Dress up 2048 according to the spec 🦎
Dress up 2048 according to the spec 🦎
1
Task
Claude Code SELF,  3 level,  4 lecture
Locked
Fix the bug using the bug note 🐛
Fix the bug using the bug note 🐛
Комментарии
  • популярные
  • новые
  • старые
Для того, чтобы оставить комментарий Вы должны sign in
This page has no comments yet