Before going to war, the ancients would cast hexagrams to see whether the prospects were good or ill.
Tips
usage
The 占 here is read zhān (first tone) — the 'divine, observe' reading — not zhàn ('occupy, take possession of'). The two readings carry very different meanings; the divination sense almost always pairs with 卦 (hexagram) or 卜 (divination).
culture
The 卦 comes from the 《易经》 (Book of Changes), which uses 64 hexagrams formed from yin and yang lines. Diviners would either cast yarrow stalks or toss coins to generate a hexagram, then interpret it.