Skip to content
forked from limboy/idiom

A Chinese Hanzi variation of Wordle - 拼音猜成语

License

Notifications You must be signed in to change notification settings

Thinking80s/idiom

 
 

Repository files navigation

简介

拼音猜成语是一个受 Wordle 启发的一个中文成语小游戏,通过输入拼音组合,结合系统给出的提示来一步步猜测给定的成语。

技术栈

设计

核心设计思想是通过 Provider 提供全局的数据和方法,其他模块可以按需消费

export function AppProvider(props) {
  const value = {
    ...state,
    pressLetter,
    storeService,
  };
  return <AppContext.Provider value={value} {...props} />;
}
// 精简后的 App.js
<AppProvider config={config()} storeService={localStorage}>
  <Board />
  <Keyboard />
  <Result />
  <Help />
  <Statistics />
</AppProvider>
export default function Board(props) {
  let { attempts, config } = useAppContext();
  // consume attempts, config
  // ...
}

License

MIT License © 2021-PRESENT Limboy

About

A Chinese Hanzi variation of Wordle - 拼音猜成语

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 93.4%
  • CSS 3.5%
  • HTML 3.1%