feat(rithmomachia): add visual winning example to Victory section

- Added cropped board example showing a winning geometric progression
- White pieces 4, 8, 16 in enemy territory (rows 5-8)
- Shows Black pieces unable to break the harmony
- Example demonstrates the primary victory condition clearly
- Added title and caption translations for English and German

The visual makes it immediately clear what a winning position looks like.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock
2025-10-31 17:01:22 -05:00
parent 1d5f01c966
commit b7fac78829
3 changed files with 63 additions and 0 deletions

View File

@@ -1440,6 +1440,18 @@ function HarmonySection({ useNativeAbacusNumbers }: { useNativeAbacusNumbers: bo
function VictorySection({ useNativeAbacusNumbers }: { useNativeAbacusNumbers: boolean }) {
const { t } = useTranslation()
// Example winning position: White has formed a geometric progression in Black's territory
const winningExample: ExamplePiece[] = [
// White's winning progression in enemy territory (rows 5-8)
{ square: 'E6', type: 'C', color: 'W', value: 4 },
{ square: 'F6', type: 'C', color: 'W', value: 8 },
{ square: 'G6', type: 'T', color: 'W', value: 16 },
// Some Black pieces remaining (unable to break the harmony)
{ square: 'C7', type: 'S', color: 'B', value: 49 },
{ square: 'J6', type: 'T', color: 'B', value: 30 },
]
return (
<div data-section="victory">
<h3
@@ -1475,6 +1487,53 @@ function VictorySection({ useNativeAbacusNumbers }: { useNativeAbacusNumbers: bo
"Form a mathematical progression with 3 pieces in enemy territory. If it survives your opponent's next turn, you win!"
)}
</p>
{/* Visual example of winning harmony */}
<div
className={css({
mb: '16px',
p: '16px',
bg: '#f9fafb',
borderRadius: '8px',
border: '2px solid #86efac',
})}
>
<p
className={css({
fontSize: '14px',
fontWeight: 'bold',
color: '#15803d',
mb: '12px',
textAlign: 'center',
})}
>
{t('guide.victory.exampleTitle', 'Example: White Wins!')}
</p>
<div className={css({ display: 'flex', justifyContent: 'center' })}>
<RithmomachiaBoard
pieces={winningExample}
scale={0.4}
cropToSquares={['B5', 'K8']}
showLabels={true}
useNativeAbacusNumbers={useNativeAbacusNumbers}
/>
</div>
<p
className={css({
fontSize: '12px',
color: '#166534',
mt: '12px',
textAlign: 'center',
fontStyle: 'italic',
})}
>
{t(
'guide.victory.exampleCaption',
'White pieces 4, 8, 16 form a geometric progression in enemy territory. Black cannot break it - White wins!'
)}
</p>
</div>
<div
className={css({
p: '12px',

View File

@@ -100,6 +100,8 @@
"title": "Wie man gewinnt",
"harmony": "Sieg #1: Harmonie (Progression)",
"harmonyDesc": "Bilden Sie eine mathematische Progression mit 3 Steinen im gegnerischen Gebiet. Wenn sie den nächsten Zug Ihres Gegners übersteht, gewinnen Sie!",
"exampleTitle": "Beispiel: Weiß gewinnt!",
"exampleCaption": "Weiße Steine 4, 8, 16 bilden eine geometrische Progression im gegnerischen Gebiet. Schwarz kann sie nicht brechen - Weiß gewinnt!",
"harmonyNote": "Dies ist die primäre Siegbedingung in Rithmomachia",
"exhaustion": "Sieg #2: Erschöpfung",
"exhaustionDesc": "Wenn Ihr Gegner zu Beginn seines Zuges keine legalen Züge hat, verliert er.",

View File

@@ -265,6 +265,8 @@
"title": "How to Win",
"harmony": "Victory #1: Harmony (Progression)",
"harmonyDesc": "Form a mathematical progression with 3 pieces in enemy territory. If it survives your opponent's next turn, you win!",
"exampleTitle": "Example: White Wins!",
"exampleCaption": "White pieces 4, 8, 16 form a geometric progression in enemy territory. Black cannot break it - White wins!",
"harmonyNote": "This is the primary victory condition in Rithmomachia",
"exhaustion": "Victory #2: Exhaustion",
"exhaustionDesc": "If your opponent has no legal moves at the start of their turn, they lose.",