HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
sumn2u
baghchal
JavaScript2023–2023
sumn2u / baghchal

baghchal

Bagchal is a strategic board game featuring AI, where tigers aim to 'hunt' goats while the goats strategically block the tiger's movements.

2Distinct people
2Mentions
0Explicit recommenders
96GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Bagchal is a strategic board game featuring AI, where tigers aim to 'hunt' goats while the goats strategically block the tiger's movements.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by hour2 dated mentions

Observed mentions: 2023-04-07 09:24:13 UTC to 2023-04-07 17:06:01 UTC.

012023-04-07 09:00:00 UTC to 2023-04-07 10:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsApr 7, 09:002023-04-07 10:00:00 UTC to 2023-04-07 11:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-04-07 11:00:00 UTC to 2023-04-07 12:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-04-07 12:00:00 UTC to 2023-04-07 13:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-04-07 13:00:00 UTC to 2023-04-07 14:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsApr 7, 13:002023-04-07 14:00:00 UTC to 2023-04-07 15:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-04-07 15:00:00 UTC to 2023-04-07 16:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-04-07 16:00:00 UTC to 2023-04-07 17:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-04-07 17:00:00 UTC to 2023-04-07 18:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsApr 7, 17:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Apr 7, 09:002023-04-07 09:00:00 UTC2023-04-07 10:00:00 UTC110
Apr 7, 10:002023-04-07 10:00:00 UTC2023-04-07 11:00:00 UTC000
Apr 7, 11:002023-04-07 11:00:00 UTC2023-04-07 12:00:00 UTC000
Apr 7, 12:002023-04-07 12:00:00 UTC2023-04-07 13:00:00 UTC000
Apr 7, 13:002023-04-07 13:00:00 UTC2023-04-07 14:00:00 UTC000
Apr 7, 14:002023-04-07 14:00:00 UTC2023-04-07 15:00:00 UTC000
Apr 7, 15:002023-04-07 15:00:00 UTC2023-04-07 16:00:00 UTC000
Apr 7, 16:002023-04-07 16:00:00 UTC2023-04-07 17:00:00 UTC000
Apr 7, 17:002023-04-07 17:00:00 UTC2023-04-07 18:00:00 UTC101

What Hacker News says

2 sources
The game seems to be glitchy about its ruleset. I lost as tigers when only six goats were placed. Edit: https://github.com/sumn2u/baghchal/blob/master/src/library/u... This is the code for legal movement and now I understand why it feels buggy: it's trying to express the logic by converting between a mishmash of numeric node indexes, directions and distances. This exposes several classes of bugs that aren't about the logic, but how the state is encoded. Two approaches that would work better are: 1. Design a node data structure with 8 directional exits. Connect the graph through that structure; express movement as a traversal through nodes along the same movement direction once or twice, rejected if it reaches a null connection or node is occupied. Express board state by serializing the node graph down to an array of "goat, tiger, empty" a
Read the rest
nd comparing the array to find repeated positions. 2. Generate the graph offline and use it to emit lookup tables for all board indexes and their possible movements. This would work as an optimization if you needed it to run very fast(e.g. real time game with thousands of goats and tigers), and it would dramatically reduce the amount of re-encoding of state going on in the inner loop.
In Board game where tigers hunt goats while goats block their movements

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.