{"id":32930177,"url":"https://github.com/sudongcu/lcg_visualizer","last_synced_at":"2026-05-15T08:01:49.529Z","repository":{"id":323004643,"uuid":"1091760316","full_name":"sudongcu/LCG_Visualizer","owner":"sudongcu","description":"A WPF application that visualizes the Linear Congruential Generator (LCG) algorithm.","archived":false,"fork":false,"pushed_at":"2025-11-25T03:00:08.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-28T12:55:37.807Z","etag":null,"topics":["algorithms","csharp","lgc","simulator","wpf"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sudongcu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-07T13:32:19.000Z","updated_at":"2025-11-25T03:00:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sudongcu/LCG_Visualizer","commit_stats":null,"previous_names":["sudongcu/lcg_visualizer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sudongcu/LCG_Visualizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudongcu%2FLCG_Visualizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudongcu%2FLCG_Visualizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudongcu%2FLCG_Visualizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudongcu%2FLCG_Visualizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sudongcu","download_url":"https://codeload.github.com/sudongcu/LCG_Visualizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudongcu%2FLCG_Visualizer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33058965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","csharp","lgc","simulator","wpf"],"created_at":"2025-11-11T14:00:15.130Z","updated_at":"2026-05-15T08:01:49.524Z","avatar_url":"https://github.com/sudongcu.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LCG Visualizer\n\nA WPF application that visualizes the Linear Congruential Generator (LCG) algorithm.\n\n## 📋 Overview\n\nLCG (Linear Congruential Generator) is one of the pseudorandom number generation algorithms that uses the following formula:\n\n```\nX_{n+1} = (a × X_n + c) mod m\n```\n\nWhere:\n- `X_n`: Current value\n- `a`: Multiplier\n- `c`: Increment\n- `m`: Modulus\n\nThis application visualizes the sequence generated by the LCG algorithm in a circular graph, allowing intuitive observation of cycle patterns.\n\n## ✨ Key Features\n\n- **Real-time Visualization**: Animated display of LCG sequence generation process\n- **Cycle Detection**: Automatic detection of sequence periods and cycle starting points\n- **Parameter Adjustment**: Free modification of m, a, c, seed values to observe various patterns\n- **Fullscreen Mode**: Optimized visualization experience\n- **Color Gradients**: Color coding for easy distinction between steps\n\n## 🚀 Usage\n\n### System Requirements\n- .NET 10.0 or higher\n- Windows OS\n- WPF-supported environment\n\n### Parameter Configuration\n\n1. **m (Modulus)**: Range of numbers to generate (positive integer)\n2. **a (Multiplier)**: Multiplier value\n3. **c (Increment)**: Increment value\n4. **seed**: Initial value\n\n### Recommended Parameter Combinations\n\nParameter selection guide for good periods:\n- **m**: Desired random number range\n- **a**: (a-1) must be divisible by all prime factors of m\n- **c**: Value coprime with m (1 recommended)\n\n#### Example Combinations:\n```\nm=9, a=4, c=1, seed=0  (default)\nm=16, a=5, c=1, seed=0\nm=32, a=5, c=1, seed=0\n```\n\n### Controls\n\n1. Enter desired parameter values in the top input fields\n2. Click the ▶ button to start visualization\n3. Use the X button to close the application\n\n## 📊 Visualization Interpretation\n\n### Screen Layout\n- **Circular Arrangement**: Numbers from 0 to m-1 arranged clockwise\n- **Arrows**: Indicate transitions between each step\n- **Colors**: Gradient colors applied for each step\n- **Red Circle**: Marks the cycle starting point\n\n### Result Analysis\n- **Cycle Length**: Period of sequence repetition\n- **Pre-cycle Length**: Length before cycle begins\n- **Visual Patterns**: Geometric patterns appearing in the circular graph\n\n## 🛠️ Tech Stack\n\n- **Language**: C#\n- **Framework**: .NET 10.0, WPF\n- **UI**: XAML\n- **Asynchronous Processing**: Task/async-await\n\n## 📁 Project Structure\n\n```\nLCG_Visualizer/\n├── MainWindow.xaml          # UI Layout\n├── MainWindow.xaml.cs       # Main logic and visualization\n├── App.xaml                 # Application configuration\n├── App.xaml.cs              # Application entry point\n└── LCG_Visualizer.csproj    # Project file\n```\n\n## 📚 Understanding LCG Algorithm\n\n### Operating Principle\n1. Start with initial seed value\n2. Repeatedly apply the formula `(a × X_n + c) mod m`\n3. Generated sequence eventually forms a cycle\n4. Cycle length and pattern are determined by parameters\n\n### Practical Applications\n- Random number generation in game development\n- Simulation and modeling\n- Cryptographic applications (simple forms)\n- Mathematical education and research\n\n## 🔧 Build and Run\n\n### Using Visual Studio:\n1. Open the solution file (`.slnx`)\n2. Press F5 for debug run or Ctrl+F5 for release run\n\n### Using Command Line:\n```bash\ncd LCG_Visualizer\ndotnet build\ndotnet run\n```\n\n![lcg](https://github.com/user-attachments/assets/9d502dd1-a828-44e4-982c-8d16b9727a43)\n\n\n## 📄 License\n\nThis project is open source and licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudongcu%2Flcg_visualizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudongcu%2Flcg_visualizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudongcu%2Flcg_visualizer/lists"}