← 返回教程文章

零代码基础怎么用AI帮你写代码(DeepSeek实战)

小卡拉米 · 2026-06-15 · 阅读约10分钟
💡 核心观点:你不需要学代码。你需要学的是怎么跟AI说话。把AI当成一个很聪明但需要你交代清楚的帮手,说清楚要什么,它就能做出来。本站就是用这个方法做的——零代码基础,AI写代码,我来提需求和改需求。

我是一个剪辑学徒,完全没学过编程。但过去一个月,我用AI写了:

全程没写过一行代码,都是让AI写的。下面把我踩过的坑、总结的方法分享给你。


第一步:选对AI工具

写代码用哪个AI?我测试过几个:

AI工具代码能力中文理解免费额度推荐度
DeepSeek★★★★★★★★★★完全免费⭐⭐⭐⭐⭐ 首选
Claude★★★★★★★★★☆需付费⭐⭐⭐⭐ 质量最高
ChatGPT★★★★☆★★★☆☆需付费⭐⭐⭐ 英文好中文一般
通义灵码★★★☆☆★★★★☆免费⭐⭐⭐ 适合简单任务

结论:新手从DeepSeek开始,免费且中文理解最好。

第二步:学会"说人话"提需求

这是最关键的一步。AI写代码的质量,90%取决于你怎么描述需求。

❌ 错误示范(太模糊)

帮我做一个网站

AI不知道你要什么,只能给个通用模板。

✅ 正确示范(具体清晰)

帮我做一个AI工具导航网站,要求:
1. 深色主题(黑色/深蓝背景)
2. 顶部固定导航栏,包含"工具导航""教程文章""赚钱攻略"三个栏目
3. 工具按分类展示(视频生成、图片生成、AI写作等)
4. 每个工具显示:图标、名称、一句话介绍、跳转链接
5. 手机端适配(屏幕宽度小于600px时卡片变单列)
6. 纯HTML+CSS+JS,不依赖任何框架
7. 中文界面

AI会给你一份完整可用的代码,直接就能用。

📌 Prompt公式:我要做 + 具体功能 + 设计风格 + 技术限制 + 特殊要求

第三步:拿到代码后怎么用

🛠️ 完整操作流程

  1. 打开DeepSeek:访问 https://chat.deepseek.com,免费注册登录
  2. 输入需求:用上面的公式,详细描述你要的功能
  3. 复制代码:AI回复后,点击代码块右上角的"复制"按钮
  4. 保存文件:打开记事本(或VS Code),粘贴,保存为 index.html
  5. 本地测试:双击 index.html,用浏览器打开看效果
  6. 提修改意见:效果不满意?直接跟AI说:"按钮颜色改成红色""导航栏固定在顶部""加上XX功能"
  7. 反复迭代:直到效果满意为止,通常3-5轮对话就能搞定

实战案例:我是怎么做出这个网站的

以本站为例,我给DeepSeek的完整Prompt:

📝 我的实际Prompt(部分)

帮我做一个AI工具导航网站,面向剪辑学徒和AI新手。
风格要求:
- 深色主题,GitHub风格(黑+深蓝)
- 现代简洁,不要花哨
- 卡片式布局

功能要求:
- 首页Hero区域:一句话Slogan + CTA按钮
- 工具导航:按分类展示(视频生成/图片生成/AI写作/AI音乐/剪辑工具)
- 教程文章列表:显示标题+日期+标签
- 赚钱攻略网格:显示摘要+标签
- 关于我:简短介绍

技术要求:
- 纯HTML+CSS+JS,不依赖框架
- 手机端适配
- 代码结构清晰,方便后续用AI修改

内容要求:
- 工具介绍要真实,我亲测过的
- 语言风格:直接、不废话、有点俏皮
- 面向中文用户

DeepSeek一次性给了 index.html + style.css + main.js 三份代码。我本地测试后,又提了3轮修改意见("导航栏固定""卡片hover效果""手机端字体太小"),最终定型。

整个过程不到2小时。

常见问题 & 解决方案

❓ AI给的代码报错了怎么办?

直接把错误信息复制给AI,说"运行后报错:XXX",AI会自动修复。通常1轮就能解决。

❓ 想要的功能AI一次没写全怎么办?

继续对话,追加需求。比如"再加上一个搜索框功能""工具卡片加上收藏按钮"。AI会在原有代码基础上修改,不用重新开始。

❓ 怎么让AI写的代码好看一点?

在Prompt里加上设计参考,比如"参考GitHub Dark主题""类似Stripe官网的风格""苹果官网的简洁感"。AI会模仿你给的参考。

❓ 我不会英文,变量名都是英文怎么办?

跟AI说"注释用中文""变量名用拼音也可以"。或者直接用,不影响运行。我到现在也分不清很多英文变量名,但不妨碍我用AI写代码。

进阶:让AI帮你写"工具脚本"

除了做网站,AI还能帮你写各种小工具脚本,提升工作效率。下面是我让AI写的几个实用脚本:

这些脚本都不需要你懂编程,AI写完后你复制保存为 .py.bat 文件,双击运行就行。

避坑指南

🎯 一句话总结:会提问比会写代码更重要。把AI当助理,你是老板,负责说清楚需求,它负责实现。练好"说人话"这项技能,比学任何编程语言都值钱。

— 小卡拉米,2026.06.15(最后更新:2026.06.23)

← Back to Tutorials

How to Use AI to Write Code for You With Zero Coding Background (DeepSeek in Practice)

Xiao Kalami · 2026-06-15 · ~10 min read
💡 Core idea: You don't need to learn to code. What you need to learn is how to talk to the AI. Treat the AI like a very smart helper that needs clear instructions from you—tell it exactly what you want, and it will build it. This very site was made this way: zero coding background, the AI writes the code, and I provide the requirements and refine them.

I'm a film-editing apprentice with zero programming experience. But over the past month, I've used AI to write:

Not a single line of code written by me—all of it done by the AI. Below I'll share the pitfalls I hit and the method I settled on.


Step 1: Pick the right AI tool

Which AI should you use for coding? I tested a few:

AI ToolCodingChineseFree QuotaRecommendation
DeepSeek★★★★★★★★★★Completely free⭐⭐⭐⭐⭐ Top pick
Claude★★★★★★★★★☆Paid⭐⭐⭐⭐ Best quality
ChatGPT★★★★☆★★★☆☆Paid⭐⭐⭐ Good English, so-so Chinese
Tongyi Lingma★★★☆☆★★★★☆Free⭐⭐⭐ Good for simple tasks

Verdict: beginners should start with DeepSeek—it's free and understands Chinese best.

Step 2: Learn to ask in plain language

This is the most critical step. The quality of the AI's code is 90% determined by how you describe the requirements.

❌ Wrong example (too vague)

Build me a website

The AI doesn't know what you want and can only hand you a generic template.

✅ Right example (specific and clear)

Build me an AI tools directory website. Requirements:
1. Dark theme (black / dark-blue background)
2. Fixed top navbar with three sections: "Tools", "Tutorials", "Money-Making Tips"
3. Tools grouped by category (video generation, image generation, AI writing, etc.)
4. Each tool shows: icon, name, one-line description, and link
5. Mobile responsive (cards collapse to a single column when screen width < 600px)
6. Pure HTML + CSS + JS, no frameworks
7. Chinese UI

The AI will give you complete, ready-to-use code that works right away.

📌 Prompt formula: What I want + specific features + design style + tech constraints + special requirements

Step 3: What to do after you get the code

🛠️ Full workflow

  1. Open DeepSeek: go to https://chat.deepseek.com and sign up / log in for free
  2. Enter your request: use the formula above and describe your feature in detail
  3. Copy the code: after the AI replies, click "Copy" at the top-right of the code block
  4. Save the file: open Notepad (or VS Code), paste, and save as index.html
  5. Test locally: double-click index.html and open it in a browser to see the result
  6. Request changes: unhappy with the result? Just tell the AI: "change the button color to red", "pin the navbar to the top", "add an XX feature"
  7. Iterate: keep going until you're happy—usually 3-5 rounds of chat do it

Case Study: How I Built This Site

Using this site as an example, here's my full prompt for DeepSeek:

📝 My actual prompt (excerpt)

Build me an AI tools directory website for film-editing apprentices and AI beginners.
Style:
- Dark theme, GitHub-style (black + dark blue)
- Modern and clean, nothing flashy
- Card-based layout

Features:
- Homepage hero: one-line slogan + CTA button
- Tools nav: grouped by category (video gen / image gen / AI writing / AI music / editing tools)
- Tutorial article list: title + date + tags
- Money-making tips grid: summary + tags
- About me: short intro

Tech:
- Pure HTML + CSS + JS, no frameworks
- Mobile responsive
- Clean code structure for easy later edits with AI

Content:
- Tool descriptions must be real and things I've personally tested
- Tone: direct, no fluff, a bit playful
- For Chinese-speaking users

DeepSeek returned index.html + style.css + main.js in one go. After local testing I gave 3 more rounds of feedback ("pin the navbar", "card hover effect", "mobile font too small") and finalized it.

The whole process took under 2 hours.

Common Issues & Solutions

❓ What if the code the AI gave me throws an error?

Just copy the error message to the AI and say "I get this error when running it: XXX"—the AI will fix it automatically. Usually solved in one round.

❓ What if the AI didn't write all the features I wanted in one go?

Keep chatting and add requests, e.g. "add a search box", "add a bookmark button to the tool cards". The AI modifies the existing code instead of starting over.

❓ How do I make the AI's code look nicer?

Add design references in the prompt, e.g. "reference the GitHub Dark theme", "like Stripe's site", "the clean feel of Apple's site". The AI will mimic your references.

❓ I don't know English; the variable names are all English, what do I do?

Tell the AI "use Chinese comments" or "pinyin variable names are fine". Or just use them as-is—it won't affect how the code runs. I still can't tell many English variable names apart, but it doesn't stop me from using AI to write code.

Advanced: Let the AI Write "Utility Scripts" for You

Besides building websites, AI can also write all kinds of small utility scripts to boost your efficiency. Here are a few practical ones I had the AI write:

None of these scripts require you to know programming. Once the AI writes them, you just copy and save as a .py or .bat file and double-click to run.

Pitfall Guide

🎯 One-line summary: asking good questions matters more than writing code. Treat the AI as your assistant and yourself as the boss—you explain the needs, it does the building. Mastering the skill of "speaking plain language" is worth more than learning any programming language.

— Xiao Kalami, 2026.06.15 (last updated: 2026.06.23)