How abdelrahman725/wordlearabic works
Project type and purpose
• This is a single-page, front-end web application: an Arabic version of the Wordle game.
• It embeds a small in-memory dictionary (nouns/adjectives only), runs entirely in the browser, and requires no server or database.
File structure
• index.html – the HTML entry point and UI scaffold.
• styles.scss / styles.css / styles.css.map – styling layers: a source SCSS file compiled to CSS with a source map.
• script.js – the core game logic (input handling, guess evaluation, UI updates).
• Dictionary.js – the word list data.
• README.md – project description and rules.
Key insights from the README
• Game rules: Arabic nouns/adjectives only, no verbs, pronouns, or diacritics.
• Front-end only: implies no API endpoints or backend services.
Main components
a. Presentation Layer (UI)
• index.html: defines the game board (grid of tiles), input controls, status messages.
b. Game Logic Layer
• script.js: listens for user keystrokes, controls game state, checks guesses against the dictionary.
c. Data Layer
• Dictionary.js: exports array of allowed words.
d. Browser Environment
• JavaScript engine, DOM, local storage (if used for persistence; note whether script.js stores scores or history).
Relationships and interactions
• On page load: index.html + styles → rendered UI.
• script.js initializes the game, loads Dictionary.js.
• On “Enter”: script.js compares guess to Dictionary.js, updates UI with feedback.
• Optional: script.js writes to localStorage for tracking past games.
Architectural patterns & design principles
• Model-View-Controller (MVC) style separation:
• Model = Dictionary data + game state variables.
• View = DOM elements styled by CSS.
• Controller = script.js event handlers and game rules.
• Single Responsibility: Dictionary.js for data; script.js for logic/UI glue; styles.scss for design.
Technologies, frameworks, libraries
• Vanilla HTML5 / CSS3 / JavaScript.
• SCSS preprocessor.
• No external frameworks (React/Vue) or build pipelines beyond SCSS compilation.
• Dependencies: which script loads which file.
• Data flow: keystrokes → logic → DOM → feedback.
• Use annotations:
• “In-memory word list” next to Dictionary.js.
• “MVC pattern” note at the overall layout.