Skip to content
choganhqPublic

About

Offline game collection: tower defence, sudoku, minesweeper, dots and boxes. Free, open source, no ads, no trackers. — مجموعه‌بازی آفلاین چوگان: رایگان، متن‌باز، بدون تبلیغ و بدون ردیاب.

Topics

Resources

Stars

56 stars

Watchers

1 watching

Forks

Repository files navigation

Chogan — چوگان

English

Chogan is a small collection of finishable games in a single app. Free, open source, no ads, no in-app purchases, no analytics or trackers, and fully offline.

Play on the web · Android builds on the Releases page

The games

Game About
Tower Defence Four towers, three fixed maps plus a daily map, twenty waves and an endless mode
Sudoku Four difficulties with a guaranteed unique solution, notes, hints and a daily challenge
Minesweeper No-guess generation, four sizes, chording and flags, daily challenge
Dots and Boxes Two players on one phone, or three levels of AI
Backgammon Two players or three levels of AI, dice that undo can never re-roll, gammons count double
Mancala Kalah rules, two players or three levels of AI
Nonogram Three sizes, every puzzle solvable by logic alone
FreeCell The classic numbered deals, never the one unwinnable deal, unlimited undo
Reversi Two players or three levels of AI
Nine Men's Morris Two players or three levels of AI
Peg Solitaire Leave one peg, in the centre for a perfect game
Battleship Against an AI that only knows what you would know
Bridges Three sizes, every puzzle with exactly one solution
Code Breaker Three levels, colour-blind friendly
Breakout Twelve fixed levels, three balls each
Pasur The Persian card game of making eleven, against three levels of AI
Mahjong Solitaire Small, medium and turtle layouts, every deal solvable, pinch to zoom on the turtle
Chess Two players or three levels of AI, plus 600 puzzles; the daily challenge is three puzzles
Hokm Four players in two teams, you and three AI players at three levels, matches to 3 or 7
Block Drop Falling blocks: a 40-line sprint and a 100-line marathon, with hold and three next pieces

Around the games: a daily challenge that is identical on every device with no server at all, a weekly offline league with five tiers, nearly eighty awards, a shared coin that is only ever spent on hints and cosmetics, stats and a profile, and a Persian, English, Simplified Chinese and German interface with light and dark themes.

Why it needs no permissions

The Android manifest declares VIBRATE and nothing else — not even internet access, because nothing in the app ever touches the network. Fonts, sounds and every asset ship inside the package; sound is generated procedurally with WebAudio, so there is not a single audio file in the build. Progress is stored on the device only, and Google auto-backup is turned off.

Building

The web version needs no build step:

python3 -m http.server -d www 8000

For a clean browser with no progress or service worker cache left over from an earlier run, use tools/dev.sh. It serves the same files, opens Chrome with a throwaway profile that is deleted when you close it, and never writes into www/. tools/dev.sh --seed also skips the first-run welcome and adds invented demo state.

The Android version needs Gradle only — no Node, no npm, no node_modules:

cd android && gradle assembleDebug

Capacitor's runtime is pulled from Maven Central as com.capacitorjs:core, and a Gradle task named syncWebAssets replaces npx cap sync.

Testing

node tools/test.js
tools/browser-check.sh

The tests extract each game engine from the published HTML file itself, between the ENGINE START and ENGINE END markers, so no second copy of the code exists for testing.

Adding a game

See NEW_GAME.md. In short: one folder under www/games/, one entry in games.json, bump the version.

Both sources ship the same signed APK

Chogan is published on F-Droid as a reproducible build. F-Droid rebuilds it from source, compares the result to the APK attached to the GitHub release, and when they match it publishes our signed file rather than re-signing with its own key.

So both sources carry the identical, identically-signed APK. You can install from either one and switch later without uninstalling, and your progress survives.

License

MIT, see LICENSE. The Vazirmatn font is under the OFL; its licence text ships beside the font in www/fonts/OFL.txt.


فارسی

مجموعه‌بازی چوگان: چند بازی کوچک و تمام‌شدنی در یک اپ. رایگان، متن‌باز، بدون تبلیغ، بدون خرید درون‌برنامه‌ای، بدون تحلیل‌گر و ردیاب، و کاملاً آفلاین.

بازی روی وب · نسخه‌ی اندروید از بخش Releases

بازی‌ها

بازی توضیح
دفاع از برج چهار برج، سه نقشه‌ی ثابت به‌علاوه‌ی نقشه‌ی روزانه، بیست موج و حالت بی‌پایان
سودوکو چهار سختی با جواب یکتای تضمین‌شده، یادداشت، راهنمایی و چالش روزانه
مین‌روب تولید بدون حدس، چهار اندازه، کورد و پرچم، چالش روزانه
نقطه‌بازی دو نفره روی یک گوشی یا مقابل هوش مصنوعی با سه سطح
تخته‌نرد دو نفره یا مقابل هوش مصنوعی با سه سطح، تاسی که با برگرداندن عوض نمی‌شود، مارس دو برابر
منقله قانون کلاه، دو نفره یا مقابل هوش مصنوعی با سه سطح
نونوگرام سه اندازه، هر جدول فقط با منطق حل می‌شود
فری‌سل دست‌های شماره‌دار کلاسیک، هرگز دست بی‌جواب، برگرداندن بی‌حد
ریورسی دو نفره یا مقابل هوش مصنوعی با سه سطح
دوز دو نفره یا مقابل هوش مصنوعی با سه سطح
میخ‌پران یک میخ بماند، در مرکز یعنی بی‌نقص
نبرد دریایی مقابل حریفی که فقط همان را می‌داند که تو می‌دانی
پل‌ها سه اندازه، هر جدول دقیقاً یک جواب
رمزشکن سه سطح، مناسب کوررنگی
آجرشکن دوازده مرحله‌ی ثابت، سه توپ در هر مرحله
پاسور بازی ورق ایرانیِ یازده‌سازی، مقابل هوش مصنوعی با سه سطح
ماهجونگ سه چیدمان کوچک، متوسط و لاک‌پشت، هر دست حل‌شدنی، بزرگ‌نمایی با دو انگشت روی لاک‌پشت
شطرنج دو نفره یا مقابل هوش مصنوعی با سه سطح، به‌علاوه‌ی ۶۰۰ معما؛ چالش روزانه سه معماست
حکم چهار نفر در دو تیم، تو و سه بازیکن هوش مصنوعی با سه سطح، بازی تا ۳ یا ۷
بلوک‌ریز بلوک‌های ریزان: سرعتی ۴۰ خط و ماراتن ۱۰۰ خط، با نگه داشتن قطعه و سه قطعه‌ی بعدی

بیرون از بازی‌ها: چالش روزانه‌ی مشترک برای همه‌ی دستگاه‌ها بدون هیچ سروری، لیگ هفتگی آفلاین با پنج رده، نزدیک هشتاد دستاورد، سکه‌ی مشترک که فقط خرج راهنمایی و تزئینات می‌شود، آمار و پروفایل، و رابط فارسی، انگلیسی، چینی ساده‌شده و آلمانی با تم روشن و تاریک.

چرا هیچ مجوزی نمی‌خواهد

منیفست اندروید فقط VIBRATE دارد و بس. حتی مجوز اینترنت هم اعلام نشده، چون هیچ‌جای اپ به شبکه وصل نمی‌شود: فونت، صدا، تصویر و همه‌ی دارایی‌ها داخل بسته‌اند. صداها با WebAudio به‌صورت رویه‌ای ساخته می‌شوند، پس حتی یک فایل صوتی هم در بسته نیست. پیشرفت فقط روی خود دستگاه ذخیره می‌شود و بکاپ خودکار گوگل هم خاموش است.

ساختار

capacitor.config.json      تنها منبع شناسه و نام بسته
www/
  index.html               منوی اصلی با پنج زبانه
  games.json               تنها منبع فهرست بازی‌ها؛ منو و سرویس‌ورکر هر دو از آن می‌خوانند
  version.js               تنها منبع نسخه برای وب و اندروید
  sw.js                    سرویس‌ورکر آفلاین، کش-اول
  lib/chogan.css           سیستم طراحی: توکن‌های رنگ و شعاع و سایه و فاصله
  lib/chogan.js            هسته‌ی مشترک همه‌ی بازی‌ها
  fonts/                   وزیرمتن، داخل بسته
  games/<id>/              هر بازی یک پوشه: index.html و icon.svg
android/                   پروژه‌ی اندروید، فقط یک فایل جاوا
template/game/             اسکلت بازی جدید
tools/                     تست خودکار موتورها و بررسی مرورگر
fastlane/metadata/         متادیتای اف‌دروید، سه‌زبانه

اجرای محلی

نسخه‌ی وب هیچ بیلدی ندارد:

python3 -m http.server -d www 8000

برای مرورگری بدون پیشرفت یا کش سرویس‌ورکرِ مانده از اجرای قبل، tools/dev.sh را بزن. همان فایل‌ها را سرو می‌کند، کروم را با پروفایل موقتی باز می‌کند که با بستنش پاک می‌شود، و چیزی داخل www/ نمی‌نویسد. tools/dev.sh --seed خوشامد اولین اجرا را هم رد می‌کند و داده‌ی نمایشی ساختگی می‌گذارد.

نسخه‌ی اندروید فقط گریدل لازم دارد. نه نود، نه npm، نه node_modules:

cd android && gradle assembleDebug

هسته‌ی کپسیتور به‌صورت com.capacitorjs:core از Maven Central می‌آید و تسک گریدل syncWebAssets جای npx cap sync را گرفته است.

تست

node tools/test.js        # موتور همه‌ی بازی‌ها، از دل همان فایل‌های منتشرشده
tools/browser-check.sh    # منو و همه‌ی بازی‌ها در کروم بدون سر

تست‌ها موتور را بین دو نشانه‌ی ENGINE START و ENGINE END از خود فایل HTML بیرون می‌کشند، پس هیچ‌وقت نسخه‌ی دومی از کد برای تست وجود ندارد. چیزهایی که واقعاً سنجیده می‌شوند: یکتا بودن جواب سودوکو، بدون حدس بودن تخته‌ی مین‌روب، قوی‌تر بودن هوش سخت نقطه‌بازی از متوسط، و بردنی ولی نه آسان بودن دفاع از برج.

بازی جدید

NEW_GAME.md را ببین. خلاصه‌اش: یک پوشه زیر www/games/، یک ورودی در games.json، بالا بردن نسخه.

انتشار

# نسخه را در www/version.js بالا ببر، چنج‌لاگ را در fastlane بنویس، بعد:
git tag v0.2.0 && git push origin v0.2.0

بقیه‌اش خودکار است: APK امضاشده ساخته می‌شود، امضایش تأیید می‌شود و همراه فایل چک‌سام به Releases می‌رود. هر تگی که به -test ختم شود بیلد آزمایشی است: از قید هم‌خوانی تگ با نسخه معاف و به‌صورت pre-release منتشر می‌شود.

سکرت‌های امضا در سطح سازمان choganhq تعریف شده‌اند: ANDROID_KEYSTORE_BASE64 و ANDROID_KEYSTORE_PASSWORD و ANDROID_KEY_ALIAS و ANDROID_KEY_PASSWORD.

هر دو منبع یک فایل امضاشده می‌دهند

چوگان روی اف‌دروید به شکل بیلد تکرارپذیر منتشر می‌شود. اف‌دروید از روی سورس دوباره بیلد می‌گیرد، نتیجه را با APK پیوست‌شده به انتشار گیت‌هاب مقایسه می‌کند، و چون یکی درمی‌آیند همان فایل امضاشده‌ی ما را منتشر می‌کند نه نسخه‌ای با کلید خودش.

پس هر دو منبع دقیقاً یک فایل با یک امضا می‌دهند. از هرکدام خواستی نصب کن و هر وقت خواستی منبعت را عوض کن؛ لازم نیست اپ را حذف کنی و پیشرفتت هم می‌ماند.

مجوز

MIT. متن کامل در LICENSE. فونت وزیرمتن زیر مجوز OFL است، متنش کنار خود فونت در www/fonts/OFL.txt.

About

Offline game collection: tower defence, sudoku, minesweeper, dots and boxes. Free, open source, no ads, no trackers. — مجموعه‌بازی آفلاین چوگان: رایگان، متن‌باز، بدون تبلیغ و بدون ردیاب.

Topics

Resources

Stars

56 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages