TGViewer
Programming & AI Tips πŸ’‘ Programming & AI Tips πŸ’‘ @programmingtip Β· 46.4K subscribers
Post #715 25.5K
πŸ” Challenge: Create a compact Maze Game in C# under 2KB without .NET Runtime, Small enough to fit in a QR Code πŸ€”

πŸ‘¨β€πŸ’» Process:
β€’ Self-Contained: Includes all necessary components to run on any OS. βœ”οΈ

β€’ Game Type: A graphical maze, utilizing Win32 APIs, avoiding WinForms. ⭐️

β€’ Size Reduction Steps:
1- Initial Size: 64MB (with CoreCLR)
2- Post-Compression: 35.2MB
3- IL Trimming Applied: 10MB
4- Native AOT Compilation: 1.13MB
5- Removing Unused Features: 923KB
6- Using bflat Compiler: 882KB
7- bflat with Zerolib: 9KB
8- Direct PInvoke: 8KB
9- Eliminating Debugging and Relocations: 7KB
10- Targeting x86 Architecture: 6.5KB
11- Final Step with Crinkler Linker: 1,936 Bytes

πŸŽ‰ Outcome: Achieved a C# game small enough to fit in a QR code!


[ Full Article πŸ”— ] : https://migeel.sk/blog/2024/01/02/building-a-self-contained-game-in-csharp-under-2-kilobytes

〰️〰️〰️〰️〰️〰️
#CSharp #DotNet #Optimization #LowLevel
@ProgrammingTip
Telegram Programming Tips Resources
More from @programmingtip
  1. Oct 5, 2026AI is changing the developer career ladder πŸš€ GitHub's latest developer career advice is r…
  2. Oct 2, 2026GPT-6 Astra gets an Ultrafast API tier πŸš€ OpenAI added an Ultrafast speed tier for GPT-6 A…
  3. Oct 1, 2026Cloudflare shipped an agentic CLI for its API ⚑️ Cloudflare launched cf, an agentic CLI fo…
  4. Sep 30, 2026OpenAI introduced Dots, always-on agents πŸš€ OpenAI introduced Dots, its take on always-on…
  5. Sep 29, 2026Claude Sonnet 5.5 is built for coding agents πŸš€ Anthropic released Claude Sonnet 5.5 for t…
  6. Sep 26, 2026Claude Opus 5.5 is available in the API πŸš€ Anthropic released Claude Opus 5.5, and it is a…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook β†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 β†’