作者用一條提示詞製作 Lingo Hop 西班牙語學習遊戲,模型使用成本為 6 cents
I vibe coded my own Duolingo with one prompt. Streaks, hearts and a party at the end, for 6 cents.
作者以一條提示詞讓 AI coding agent 製作西班牙語學習遊戲 Lingo Hop,模型使用成本為 6 cents,耗時不到五分鐘。遊戲包含五節課、連勝紀錄、愛心、XP、兩種練習及完成慶祝畫面;Agent 實際測試首課,8 題答對 7 題、失去 1 顆愛心並取得 90 XP,之後按追加要求加入每日目標圓環。
A language app is mostly game design. There is a path of lessons, a streak you do not want to lose, hearts that go when you make a mistake, and a small celebration when you finish. Every one of those is a piece of state that has to agree with the others, which makes it a good test for an AI coding agent.
So I opened an empty folder, typed one paragraph, and let the agent work. Under five minutes later I had Lingo Hop: a phone-sized app that teaches Spanish, with five lessons on a winding path, a streak counter, hearts, XP, two kinds of exercises and a trophy screen at the end. It cost 6 cents of model use.
Here is the real run, sped up:
The prompt
Build a language learning app like Duolingo, called Lingo Hop, shown inside a phone frame in the middle of the page. It teaches Spanish. A home screen with a path of five lessons, a streak counter, hearts and XP. A lesson has eight exercises of two kinds: pick the right translation from four choices, and build the sentence by tapping word tiles. Green or red feedback bar after each answer, lose a heart on a mistake, and a celebration screen with XP at the end. Remember progress in the browser. Bright, playful design. Give it its own name, colours and logo; do not copy any brand. Plain HTML, CSS and JavaScript, no build tools and no installs.
Three things in that prompt did most of the work:
- "Shown inside a phone frame in the middle of the page." A mobile app opened on a laptop looks stretched and unfinished. One sentence, and it looks like a product in a demo.
- "Eight exercises of two kinds." Naming both kinds, picking a translation from four choices and building a sentence from word tiles, is what gets you lessons, not one quiz question repeated eight times.
- "Lose a heart on a mistake, and a celebration screen with XP at the end." That is the whole game in one line: what a mistake costs, and what finishing gives.
What the agent actually did
- It wrote three plain files: the page, the styles and the app code. No build step and nothing to install.
- Then it played its own app. In its browser it took the first lesson from the first exercise to the last: 7 of 8 right, one heart lost, 90 XP earned, and the progress saved in the browser.
- It looked at the celebration screen and read the console, which showed no errors.
- It added a screen I had not asked for: when the hearts run out, the app offers to refill them and try again.
It also told me where it had stopped: only the first lesson was played from start to finish, and the rest went on its own list of things to check next. I trust that more than "done, everything works".
Then I asked for one more thing
Add a daily goal ring on the home screen that fills up as I earn XP.
Under a minute later there was a ring at the top of the home screen. The agent worked out that the ring needs its own count of XP that starts again each day, and made sure progress saved before the change would still load. Then it went back to its browser to check: the ring at zero after a reload, and a lesson to see it fill.
What it is, and what it is not
It is a real, working language game for one person in one browser. It is not Duolingo: five short lessons, no accounts, no sync, no speaking or listening. For a prototype, a teaching tool for your own word list, or the start of a real project, that is exactly the part you want done in minutes.
Try the same prompt
I used VibeCode.surf, a desktop AI code editor built around agents: they write the code, run it, and test it in a real browser on your own computer, with any model you choose. It runs on Mac, Windows and Linux and starts with a 7-day free trial.
Copy the prompt above, change the language, and see what yours looks like.
來源:DEV Community · dev.to