Skip to content

jmatthes/word-score-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This is a word score game. The goal of the game is to get the most points by making an English word with letters you took from the bag. Each letter has a point value, and each letter can only be used once in your turn. The bag has 100 letters in it. Once you use a letter from the bag it will be discarded. The game is over when all the letter have been drawn from the bag and your hand is empty. You can release your hand if you don't have any words to make, but you can not get the value of those letters.

游戏规则: 这是一个单词分数游戏。游戏的目标是通过从字母包中取出一个英文单词来获得最多的分数。每个字母都有一个分数,每个字母只能轮流使用一次。包里有100个字母。一旦你使用了一个字母,它将被丢弃。当所有的字母都从袋子中取出并且你的手是空的时,游戏结束了。如果你没有拼出任何单词,可以释放你的手(点击"retire the hand"),丢弃所有选取的字母,但你将不能得到这些字母的分数。

Your Tasks

  • Write logic to "end the game" when all letters are used from the bag and you have released your last unused letters from your hand. - Write the JavaScript needed to find the highest point word available in the dictionary.
  • Write the JavaScript to allow the "blank" space to be a wild card. It can be any letter that is missing from the word, but is worth no points. For example if I had the letters "H" "E" "L" "S" "S" "_" "_" I could make the word "HELLO" by using "H" "E" "L" "_" "_".

任务:

  • 写入逻辑以“结束游戏”,当所有的字母从包中取出使用,而且你已经释放了你的手。 编写Javascript以获取所有单词最高分(单词需要在字典"wordBank.js"中找到)。

进阶任务:

  • 编写JavaScript以允许"_"下划线为通配符。它可以是任何一个缺失的字母,但"_"不计分。例如,如果我有字母“H”“E”“L”“S”“S”“_”“_”我可以使用“H”“E”“L”“ _“”_“。 (如果你更擅长其他编程语言,欢迎使用任何语言)

Bonus

  • Make the HTML look pretty
  • Clean up the existing JavaScript code to be well formatted and have better performance (useless looping, use recursion when needed)

边线任务:

  1. 让HTML页面更好看
  2. 清理、改善现有的JavaScript代码格式,使其有更好的性能(无用的循环,只在需要时使用递归)

Guide

  1. 注册Github,打开项目源代码链接,https://github.com/jmatthes/word-score-game。
  2. 点击"Fork",拷贝一份到自己账号下。
  3. 下载notepad或其他编辑器,打开源文件中的js文件
  4. 理解题目需求,阅读源代码,编辑js
  5. 打开index.html,运行测试效果
  6. 完成开发后,上传编译后的所有文件到你的项目中,关注以下微信公众号提交你的项目链接。

Q&A

联系我们

  1. 关注微信公众号:"joinADC"。
  2. 如有问题,直接发送问题至聊天窗口,后台4小时内会有人答复。
  3. 完成任务后,将你的项目链接以:姓名_学校名字_url的格式发送到聊天窗口,即完成任务提交。逾期视为自动放弃。

请在规定时间内,完成尽量多的试题,我们会在一周内择优通知进行终面。谢谢!

Thanks

A special thanks to WordList-JS for the dictionary JavaScript library.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages