欢迎大家来到IT世界,在知识的湖畔探索吧!
先看一看我们的最终成型的3款自己制作的游戏,只需要用Windows系统自带的文档工具编写。

欢迎大家来到IT世界,在知识的湖畔探索吧!
整个过程我们做了一个视频教程
一、使用deepseek生成第一款单词卡片的命令表述:
识别附件中的单词并排序,同时给出每个词的释义和例句,然后帮我生成单词flashcard的互动html页面,辅助单词记忆
1.界面要求精美直观,单词卡片可以3d翻转,卡片下面有一个随机切换下一词的按钮
2.交互按钮要能正常使用,布局合理,不要有重叠重合
3.生成切换单元的按钮,选中的单元中单词都要包含其中,一次生成完,不可省略
4.联网点击播放单词的读音,并显示音标
5.单词库仅限于附件中的单词,不要联想扩展
6.同时根据系统时间自动切换白天和黑夜模式,保护视力。
欢迎大家来到IT世界,在知识的湖畔探索吧!
上传的附件是单词库,TXT文件最好。
生成的初次代码如下:
欢迎大家来到IT世界,在知识的湖畔探索吧!
单词Flashcard <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
单词Flashcard-官网www.fdccw.com
0/0
单词
音标
单词
音标
释义
例句
<script> // Word data from the attachment const wordData = [ // Unit 1 [ { word: "fox", phonetic: "[fpks]", meaning: "狐狸", example: "The fox is very clever." }, { word: "giraffe", phonetic: "[d3a'ra:f]", meaning: "长颈鹿", example: "The giraffe has a long neck." }, { word: "eagle", phonetic: "['i:gl]", meaning: "雕;鹰", example: "The eagle is flying high in the sky." }, { word: "wolf", phonetic: "[wolf]", meaning: "狼", example: "The wolf is howling at the moon." }, { word: "penguin", phonetic: "['pengwin]", meaning: "企鹅", example: "Penguins live in Antarctica." }, { word: "care", phonetic: "[kea(r)]", meaning: "照顾;护理;关心;在乎", example: "She takes care of her little brother." }, { word: "take care of", phonetic: "[teIk kea(r) pv]", meaning: "照顾;处理", example: "I will take care of the problem." }, ], // Unit 2 [ { word: "rule", phonetic: "[ru:1]", meaning: "规则;规章", example: "You must follow the school rules." }, { word: "order", phonetic: "['o:do(r)]", meaning: "秩序;点菜", example: "The teacher kept order in the classroom." }, { word: "follow", phonetic: "['fplo]", meaning: "遵循;跟随", example: "Please follow the instructions carefully." }, { word: "be late(for)", phonetic: "[bi: left(fo:(r))]", meaning: "迟到", example: "Don't be late for school." }, { word: "arrive", phonetic: "[a'raIv]", meaning: "到达", example: "We arrived at the airport at 9 o'clock." }, { word: "on time", phonetic: "[on taIm]", meaning: "准时", example: "The train arrived on time." }, { word: "hallway", phonetic: "['ho:lwei]", meaning: "走廊", example: "Don't run in the hallway." }, ] ]; // DOM elements const flashcard = document.getElementById('flashcard'); const wordElement = document.getElementById('word'); const phoneticElement = document.getElementById('phonetic'); const wordBackElement = document.getElementById('word-back'); const phoneticBackElement = document.getElementById('phonetic-back'); const meaningElement = document.getElementById('meaning'); const exampleElement = document.getElementById('example'); const pronounceBtn = document.getElementById('pronounceBtn'); const nextBtn = document.getElementById('nextBtn'); const unitSelector = document.getElementById('unitSelector'); const progressElement = document.getElementById('progress'); const darkModeBtn = document.getElementById('darkModeBtn'); // State variables let currentUnit = 0; let currentWordIndex = 0; let currentWords = []; // Initialize the app function init() { createUnitButtons(); loadUnit(0); updateProgress(); checkTimeForDarkMode(); // Event listeners flashcard.addEventListener('click', flipCard); pronounceBtn.addEventListener('click', pronounceWord); nextBtn.addEventListener('click', nextWord); darkModeBtn.addEventListener('click', toggleDarkMode); } // Create unit selection buttons function createUnitButtons() { for (let i = 0; i < worddata.length i const btn='document.createElement('button');' btn.classname='unit-btn' if i='== 0)' btn.classlist.addactive btn.textcontent='`Unit' i 1 btn.addeventlistenerclick> { loadUnit(i); document.querySelectorAll('.unit-btn').forEach(b => b.classList.remove('active')); btn.classList.add('active'); }); unitSelector.appendChild(btn); } } // Load a unit's words function loadUnit(unitIndex) { currentUnit = unitIndex; currentWords = [...wordData[unitIndex]]; currentWordIndex = 0; shuffleArray(currentWords); // Shuffle the words for variety showCurrentWord(); } // Show current word on the flashcard function showCurrentWord() { const word = currentWords[currentWordIndex]; wordElement.textContent = word.word; phoneticElement.textContent = word.phonetic; wordBackElement.textContent = word.word; phoneticBackElement.textContent = word.phonetic; meaningElement.textContent = word.meaning; exampleElement.textContent = word.example; // Reset card to front if (flashcard.classList.contains('flipped')) { flashcard.classList.remove('flipped'); } updateProgress(); } // Flip the card function flipCard() { flashcard.classList.toggle('flipped'); } // Pronounce the current word function pronounceWord() { const word = currentWords[currentWordIndex].word; // Use the Web Speech API to pronounce the word if ('speechSynthesis' in window) { const utterance = new SpeechSynthesisUtterance(word); utterance.lang = 'en-US'; window.speechSynthesis.speak(utterance); } else { alert('Your browser does not support text-to-speech. Try Chrome or Edge.'); } } // Go to next word function nextWord() { currentWordIndex = (currentWordIndex + 1) % currentWords.length; showCurrentWord(); } // Update progress indicator function updateProgress() { progressElement.textContent = `${currentWordIndex + 1}/${currentWords.length}`; } // Shuffle array (Fisher-Yates algorithm) function shuffleArray(array) { for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; } return array; } // Check time for dark mode function checkTimeForDarkMode() { const hour = new Date().getHours(); if (hour >= 18 || hour <= 6) { // 6pm to 6am document.body.classList.add('dark-mode'); darkModeBtn.textContent = '☀️'; } else { document.body.classList.remove('dark-mode'); darkModeBtn.textContent = ''; } } // Toggle dark mode function toggleDarkMode() { document.body.classList.toggle('dark-mode'); if (document.body.classList.contains('dark-mode')) { darkModeBtn.textContent = '☀️'; } else { darkModeBtn.textContent = ''; } } // Initialize the app when DOM is loaded document.addEventListener('DOMContentLoaded', init); </script>
将以上代码复制到一个空白的文档文件中,保存后重命名“.txt”为“.HTML”。
这样就可以生成游戏,右键点击用浏览器打开。
当然,我们最终生成的游戏,是经过多次修改,并把初中3个年级的单词使用deepseek提取出可用的单词格式。
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://itzsg.com/119058.html