ovos-skill-backgammon 0.1.0a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. ovos_skill_backgammon-0.1.0a1/LICENSE +201 -0
  2. ovos_skill_backgammon-0.1.0a1/PKG-INFO +131 -0
  3. ovos_skill_backgammon-0.1.0a1/README.md +105 -0
  4. ovos_skill_backgammon-0.1.0a1/__init__.py +71 -0
  5. ovos_skill_backgammon-0.1.0a1/boardgame.py +440 -0
  6. ovos_skill_backgammon-0.1.0a1/controlpanel.json +116 -0
  7. ovos_skill_backgammon-0.1.0a1/controlpanel.svg +1 -0
  8. ovos_skill_backgammon-0.1.0a1/engine.py +438 -0
  9. ovos_skill_backgammon-0.1.0a1/icon.png +0 -0
  10. ovos_skill_backgammon-0.1.0a1/icon.svg +1 -0
  11. ovos_skill_backgammon-0.1.0a1/locale/ca-ES/backgammon.json +201 -0
  12. ovos_skill_backgammon-0.1.0a1/locale/ca-ES/backgammon_skill.voc +1 -0
  13. ovos_skill_backgammon-0.1.0a1/locale/ca-ES/controlpanel.json +25 -0
  14. ovos_skill_backgammon-0.1.0a1/locale/ca-ES/play.intent +9 -0
  15. ovos_skill_backgammon-0.1.0a1/locale/ca-ES/skill.json +28 -0
  16. ovos_skill_backgammon-0.1.0a1/locale/da-DK/backgammon.json +207 -0
  17. ovos_skill_backgammon-0.1.0a1/locale/da-DK/backgammon_skill.voc +1 -0
  18. ovos_skill_backgammon-0.1.0a1/locale/da-DK/controlpanel.json +25 -0
  19. ovos_skill_backgammon-0.1.0a1/locale/da-DK/play.intent +9 -0
  20. ovos_skill_backgammon-0.1.0a1/locale/da-DK/skill.json +28 -0
  21. ovos_skill_backgammon-0.1.0a1/locale/de-DE/backgammon.json +204 -0
  22. ovos_skill_backgammon-0.1.0a1/locale/de-DE/backgammon_skill.voc +1 -0
  23. ovos_skill_backgammon-0.1.0a1/locale/de-DE/controlpanel.json +25 -0
  24. ovos_skill_backgammon-0.1.0a1/locale/de-DE/play.intent +9 -0
  25. ovos_skill_backgammon-0.1.0a1/locale/de-DE/skill.json +28 -0
  26. ovos_skill_backgammon-0.1.0a1/locale/en-US/backgammon.json +205 -0
  27. ovos_skill_backgammon-0.1.0a1/locale/en-US/backgammon_skill.voc +1 -0
  28. ovos_skill_backgammon-0.1.0a1/locale/en-US/controlpanel.json +25 -0
  29. ovos_skill_backgammon-0.1.0a1/locale/en-US/play.intent +9 -0
  30. ovos_skill_backgammon-0.1.0a1/locale/en-US/skill.json +28 -0
  31. ovos_skill_backgammon-0.1.0a1/locale/es-ES/backgammon.json +203 -0
  32. ovos_skill_backgammon-0.1.0a1/locale/es-ES/backgammon_skill.voc +1 -0
  33. ovos_skill_backgammon-0.1.0a1/locale/es-ES/controlpanel.json +25 -0
  34. ovos_skill_backgammon-0.1.0a1/locale/es-ES/play.intent +9 -0
  35. ovos_skill_backgammon-0.1.0a1/locale/es-ES/skill.json +28 -0
  36. ovos_skill_backgammon-0.1.0a1/locale/eu-ES/backgammon.json +198 -0
  37. ovos_skill_backgammon-0.1.0a1/locale/eu-ES/backgammon_skill.voc +1 -0
  38. ovos_skill_backgammon-0.1.0a1/locale/eu-ES/controlpanel.json +25 -0
  39. ovos_skill_backgammon-0.1.0a1/locale/eu-ES/play.intent +9 -0
  40. ovos_skill_backgammon-0.1.0a1/locale/eu-ES/skill.json +28 -0
  41. ovos_skill_backgammon-0.1.0a1/locale/fr-FR/backgammon.json +202 -0
  42. ovos_skill_backgammon-0.1.0a1/locale/fr-FR/backgammon_skill.voc +1 -0
  43. ovos_skill_backgammon-0.1.0a1/locale/fr-FR/controlpanel.json +25 -0
  44. ovos_skill_backgammon-0.1.0a1/locale/fr-FR/play.intent +9 -0
  45. ovos_skill_backgammon-0.1.0a1/locale/fr-FR/skill.json +28 -0
  46. ovos_skill_backgammon-0.1.0a1/locale/gl-ES/backgammon.json +201 -0
  47. ovos_skill_backgammon-0.1.0a1/locale/gl-ES/backgammon_skill.voc +1 -0
  48. ovos_skill_backgammon-0.1.0a1/locale/gl-ES/controlpanel.json +25 -0
  49. ovos_skill_backgammon-0.1.0a1/locale/gl-ES/play.intent +9 -0
  50. ovos_skill_backgammon-0.1.0a1/locale/gl-ES/skill.json +28 -0
  51. ovos_skill_backgammon-0.1.0a1/locale/it-IT/backgammon.json +200 -0
  52. ovos_skill_backgammon-0.1.0a1/locale/it-IT/backgammon_skill.voc +1 -0
  53. ovos_skill_backgammon-0.1.0a1/locale/it-IT/controlpanel.json +25 -0
  54. ovos_skill_backgammon-0.1.0a1/locale/it-IT/play.intent +9 -0
  55. ovos_skill_backgammon-0.1.0a1/locale/it-IT/skill.json +28 -0
  56. ovos_skill_backgammon-0.1.0a1/locale/nb-NO/backgammon.json +202 -0
  57. ovos_skill_backgammon-0.1.0a1/locale/nb-NO/backgammon_skill.voc +1 -0
  58. ovos_skill_backgammon-0.1.0a1/locale/nb-NO/controlpanel.json +25 -0
  59. ovos_skill_backgammon-0.1.0a1/locale/nb-NO/play.intent +9 -0
  60. ovos_skill_backgammon-0.1.0a1/locale/nb-NO/skill.json +28 -0
  61. ovos_skill_backgammon-0.1.0a1/locale/nl-NL/backgammon.json +203 -0
  62. ovos_skill_backgammon-0.1.0a1/locale/nl-NL/backgammon_skill.voc +1 -0
  63. ovos_skill_backgammon-0.1.0a1/locale/nl-NL/controlpanel.json +25 -0
  64. ovos_skill_backgammon-0.1.0a1/locale/nl-NL/play.intent +9 -0
  65. ovos_skill_backgammon-0.1.0a1/locale/nl-NL/skill.json +28 -0
  66. ovos_skill_backgammon-0.1.0a1/locale/pt-BR/backgammon.json +202 -0
  67. ovos_skill_backgammon-0.1.0a1/locale/pt-BR/backgammon_skill.voc +1 -0
  68. ovos_skill_backgammon-0.1.0a1/locale/pt-BR/controlpanel.json +25 -0
  69. ovos_skill_backgammon-0.1.0a1/locale/pt-BR/play.intent +10 -0
  70. ovos_skill_backgammon-0.1.0a1/locale/pt-BR/skill.json +28 -0
  71. ovos_skill_backgammon-0.1.0a1/locale/pt-PT/backgammon.json +202 -0
  72. ovos_skill_backgammon-0.1.0a1/locale/pt-PT/backgammon_skill.voc +1 -0
  73. ovos_skill_backgammon-0.1.0a1/locale/pt-PT/controlpanel.json +25 -0
  74. ovos_skill_backgammon-0.1.0a1/locale/pt-PT/play.intent +10 -0
  75. ovos_skill_backgammon-0.1.0a1/locale/pt-PT/skill.json +28 -0
  76. ovos_skill_backgammon-0.1.0a1/locale/sv-SE/backgammon.json +203 -0
  77. ovos_skill_backgammon-0.1.0a1/locale/sv-SE/backgammon_skill.voc +1 -0
  78. ovos_skill_backgammon-0.1.0a1/locale/sv-SE/controlpanel.json +25 -0
  79. ovos_skill_backgammon-0.1.0a1/locale/sv-SE/play.intent +9 -0
  80. ovos_skill_backgammon-0.1.0a1/locale/sv-SE/skill.json +28 -0
  81. ovos_skill_backgammon-0.1.0a1/ovos_skill_backgammon.egg-info/PKG-INFO +131 -0
  82. ovos_skill_backgammon-0.1.0a1/ovos_skill_backgammon.egg-info/SOURCES.txt +174 -0
  83. ovos_skill_backgammon-0.1.0a1/ovos_skill_backgammon.egg-info/dependency_links.txt +1 -0
  84. ovos_skill_backgammon-0.1.0a1/ovos_skill_backgammon.egg-info/entry_points.txt +2 -0
  85. ovos_skill_backgammon-0.1.0a1/ovos_skill_backgammon.egg-info/requires.txt +4 -0
  86. ovos_skill_backgammon-0.1.0a1/ovos_skill_backgammon.egg-info/top_level.txt +1 -0
  87. ovos_skill_backgammon-0.1.0a1/picture.py +156 -0
  88. ovos_skill_backgammon-0.1.0a1/pyproject.toml +46 -0
  89. ovos_skill_backgammon-0.1.0a1/screenshot-portrait.png +0 -0
  90. ovos_skill_backgammon-0.1.0a1/screenshot.png +0 -0
  91. ovos_skill_backgammon-0.1.0a1/setup.cfg +4 -0
  92. ovos_skill_backgammon-0.1.0a1/spoken_numbers.py +132 -0
  93. ovos_skill_backgammon-0.1.0a1/tests/test_boardgame.py +134 -0
  94. ovos_skill_backgammon-0.1.0a1/tests/test_engine.py +194 -0
  95. ovos_skill_backgammon-0.1.0a1/tests/test_locale.py +42 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,131 @@
1
+ Metadata-Version: 2.4
2
+ Name: ovos-skill-backgammon
3
+ Version: 0.1.0a1
4
+ Summary: Backgammon against Emkay, by voice
5
+ Author: emkay-voice
6
+ Maintainer: Andreas Lorensen
7
+ License: Apache-2.0
8
+ Project-URL: Homepage, https://github.com/emkay-voice/ovos-skill-backgammon
9
+ Project-URL: Issues, https://github.com/emkay-voice/ovos-skill-backgammon/issues
10
+ Project-URL: Emkay, https://github.com/emkay-voice/emkay
11
+ Project-URL: Icon, https://raw.githubusercontent.com/emkay-voice/ovos-skill-backgammon/main/icon.png
12
+ Keywords: ovos,openvoiceos,skill,voice,assistant,game,board game,emkay,backgammon,dice
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Intended Audience :: End Users/Desktop
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Topic :: Games/Entertainment :: Board Games
18
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
19
+ Requires-Python: >=3.10
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: ovos-workshop<10.0.0,>=0.0.15
23
+ Provides-Extra: test
24
+ Requires-Dist: pytest; extra == "test"
25
+ Dynamic: license-file
26
+
27
+ # <img src='icon.png' card_color='#7F1D1D' width='50' height='50' style='vertical-align:bottom'/> Backgammon
28
+
29
+ **Backgammon against Emkay, by voice.** The points are numbered 1 to 24 from your side, for both
30
+ players, so a move is just *"13 to 7"* – *"bar to 22"*, *"6 off"*. Say *roll*, or the two numbers you
31
+ rolled on real dice. Emkay rolls its own dice on the screen and says its moves in the same numbers –
32
+ *"I roll 6 and 4: 1 to 7 and 12 to 16"* – so you can play on the screen, or on your own board and
33
+ move Emkay's checkers as it says. Easy, normal or hard. Made for [Emkay](https://emkay.ai), works on
34
+ any OpenVoiceOS.
35
+
36
+ <img src='screenshot.png' alt='Backgammon on a lying screen' height='300'/> <img src='screenshot-portrait.png' alt='Backgammon on a standing screen' height='300'/>
37
+
38
+ ## Examples
39
+
40
+ ```
41
+ "play backgammon" "play backgammon with real dice" "play backgammon, you start"
42
+ "roll" "6 and 4" "double three"
43
+ "13 to 7" "13 to 7 and 8 to 7" "24 to 13" "bar to 22" "6 off"
44
+ "13" (where can it go?) "undo"
45
+ "how many pips?" "give me a hint" "what was your move?"
46
+ "show the rules" "help" "stop playing"
47
+
48
+ "spil backgammon", "slå", "13 til 7", "baren til 22", "6 ud", "hvor mange øjne",
49
+ "fortryd", "spil backgammon med rigtige terninger", "vis reglerne" (Danish)
50
+ ```
51
+
52
+ Moves can be said one at a time or several together. One checker can use both dice – *"24 to 13"*
53
+ with a 6 and a 5 – as long as the point in between is open. *Undo* takes back your moves of this
54
+ turn, so a wrong word costs nothing.
55
+
56
+ While you play, everything you say goes to the game first – before any other skill – until you
57
+ say *stop* or *stop playing* (the game is saved), or a few minutes pass in silence.
58
+
59
+ ## The rules
60
+
61
+ *"Show the rules"* puts them on the screen as a page of their own, and Emkay reads them. They are on
62
+ the skill's page in the control panel too.
63
+
64
+ - Your fifteen white checkers go from 24 down to 1 and off; Emkay's red go the other way.
65
+ - Roll two dice and move a checker the number on each die – or one checker both. A double plays four
66
+ times. Use both dice if you can (only the larger, if just one can be played).
67
+ - A point with two or more of the other's checkers is closed. A lone checker can be hit: it goes on
68
+ the bar and must come in again before anything else moves.
69
+ - When all your checkers are home, points 1 to 6, bear them off. The first with all fifteen off wins
70
+ – a **gammon** if the other has none off. (There is no doubling cube.)
71
+
72
+ ## Emkay's play
73
+
74
+ Emkay plays every legal way of using its roll and picks the one that leaves it best placed: ahead in
75
+ the race, with points made at home and in a row, few lone checkers within reach of yours, and your
76
+ checkers on the bar. On *easy* it picks among its better plays at random; on *hard* it weighs the
77
+ risk to its lone checkers and its blocking points more. *"Give me a hint"* tells you what it would
78
+ play with your dice.
79
+
80
+ ## "Play ..." and OCP
81
+
82
+ OpenVoiceOS lets its media player (OCP) answer every *play ...*. So Backgammon is a common play
83
+ skill too: when OCP searches for "backgammon", the skill answers with the game (`MediaType.GAME`),
84
+ and OCP hands it over. When the game ends, OCP is told, so *pause*, *next* and *play* are the
85
+ music's again.
86
+
87
+ ## Saved as you go
88
+
89
+ After every turn the game is saved – on the device, and with My Emkay for your other devices too.
90
+ *Stop playing*, and *play backgammon* goes on where you were. *Start backgammon over* starts again.
91
+
92
+ ## Pictures
93
+
94
+ The board from your side: the 24 long triangles numbered 1 to 24 (1 at the bottom right, next to the
95
+ tray), white and red checkers, the bar in the middle, the checkers borne off, the dice, and how many
96
+ pips each side has left. Emkay's last checkers moved are ringed in gold. One plain SVG, so it shows
97
+ on every screen, the Mark II's too. On a standing screen – Emkay on a phone – the dice and the count
98
+ go under the board. No background music.
99
+
100
+ ## Settings
101
+
102
+ In the control panel (*Backgammon*, under Everyday): the game on now or the saved one, start it on
103
+ the device, start over, stop – and **Your dice** (on the screen, or real dice you tell Emkay about),
104
+ **Show pictures** and **Layout** (`auto`, `portrait`, `landscape`).
105
+
106
+ ## For developers
107
+
108
+ The rules and Emkay's play (`engine.py`) are plain Python with no OVOS in it:
109
+ `Game(new_game(), words).handle("roll")`; `plays(start(), [6, 1])` lists every legal way to play a
110
+ roll. The game is a small dict that is saved as JSON. The words of each language are in
111
+ `locale/<lang>/backgammon.json`; spoken numbers are in `spoken_numbers.py`. `boardgame.py` is what
112
+ every board game of emkay-voice does the same way.
113
+
114
+ ## Languages
115
+
116
+ Catalan, Danish, Dutch, English, French, Galician, German, Italian, Norwegian (bokmål), Portuguese
117
+ (Brazil and Portugal, where it is *Gamão*), Spanish, Swedish and Basque. Everything except English
118
+ and Danish is machine translated and only loosely read through by a native Dane – corrections are
119
+ very welcome.
120
+
121
+ ## Category
122
+
123
+ **Entertainment**
124
+
125
+ ## Tags
126
+
127
+ #game #boardgame #backgammon #dice #emkay
128
+
129
+ ## License
130
+
131
+ Apache-2.0. Made by [emkay-voice](https://github.com/emkay-voice), maintained by Andreas Lorensen.
@@ -0,0 +1,105 @@
1
+ # <img src='icon.png' card_color='#7F1D1D' width='50' height='50' style='vertical-align:bottom'/> Backgammon
2
+
3
+ **Backgammon against Emkay, by voice.** The points are numbered 1 to 24 from your side, for both
4
+ players, so a move is just *"13 to 7"* – *"bar to 22"*, *"6 off"*. Say *roll*, or the two numbers you
5
+ rolled on real dice. Emkay rolls its own dice on the screen and says its moves in the same numbers –
6
+ *"I roll 6 and 4: 1 to 7 and 12 to 16"* – so you can play on the screen, or on your own board and
7
+ move Emkay's checkers as it says. Easy, normal or hard. Made for [Emkay](https://emkay.ai), works on
8
+ any OpenVoiceOS.
9
+
10
+ <img src='screenshot.png' alt='Backgammon on a lying screen' height='300'/> <img src='screenshot-portrait.png' alt='Backgammon on a standing screen' height='300'/>
11
+
12
+ ## Examples
13
+
14
+ ```
15
+ "play backgammon" "play backgammon with real dice" "play backgammon, you start"
16
+ "roll" "6 and 4" "double three"
17
+ "13 to 7" "13 to 7 and 8 to 7" "24 to 13" "bar to 22" "6 off"
18
+ "13" (where can it go?) "undo"
19
+ "how many pips?" "give me a hint" "what was your move?"
20
+ "show the rules" "help" "stop playing"
21
+
22
+ "spil backgammon", "slå", "13 til 7", "baren til 22", "6 ud", "hvor mange øjne",
23
+ "fortryd", "spil backgammon med rigtige terninger", "vis reglerne" (Danish)
24
+ ```
25
+
26
+ Moves can be said one at a time or several together. One checker can use both dice – *"24 to 13"*
27
+ with a 6 and a 5 – as long as the point in between is open. *Undo* takes back your moves of this
28
+ turn, so a wrong word costs nothing.
29
+
30
+ While you play, everything you say goes to the game first – before any other skill – until you
31
+ say *stop* or *stop playing* (the game is saved), or a few minutes pass in silence.
32
+
33
+ ## The rules
34
+
35
+ *"Show the rules"* puts them on the screen as a page of their own, and Emkay reads them. They are on
36
+ the skill's page in the control panel too.
37
+
38
+ - Your fifteen white checkers go from 24 down to 1 and off; Emkay's red go the other way.
39
+ - Roll two dice and move a checker the number on each die – or one checker both. A double plays four
40
+ times. Use both dice if you can (only the larger, if just one can be played).
41
+ - A point with two or more of the other's checkers is closed. A lone checker can be hit: it goes on
42
+ the bar and must come in again before anything else moves.
43
+ - When all your checkers are home, points 1 to 6, bear them off. The first with all fifteen off wins
44
+ – a **gammon** if the other has none off. (There is no doubling cube.)
45
+
46
+ ## Emkay's play
47
+
48
+ Emkay plays every legal way of using its roll and picks the one that leaves it best placed: ahead in
49
+ the race, with points made at home and in a row, few lone checkers within reach of yours, and your
50
+ checkers on the bar. On *easy* it picks among its better plays at random; on *hard* it weighs the
51
+ risk to its lone checkers and its blocking points more. *"Give me a hint"* tells you what it would
52
+ play with your dice.
53
+
54
+ ## "Play ..." and OCP
55
+
56
+ OpenVoiceOS lets its media player (OCP) answer every *play ...*. So Backgammon is a common play
57
+ skill too: when OCP searches for "backgammon", the skill answers with the game (`MediaType.GAME`),
58
+ and OCP hands it over. When the game ends, OCP is told, so *pause*, *next* and *play* are the
59
+ music's again.
60
+
61
+ ## Saved as you go
62
+
63
+ After every turn the game is saved – on the device, and with My Emkay for your other devices too.
64
+ *Stop playing*, and *play backgammon* goes on where you were. *Start backgammon over* starts again.
65
+
66
+ ## Pictures
67
+
68
+ The board from your side: the 24 long triangles numbered 1 to 24 (1 at the bottom right, next to the
69
+ tray), white and red checkers, the bar in the middle, the checkers borne off, the dice, and how many
70
+ pips each side has left. Emkay's last checkers moved are ringed in gold. One plain SVG, so it shows
71
+ on every screen, the Mark II's too. On a standing screen – Emkay on a phone – the dice and the count
72
+ go under the board. No background music.
73
+
74
+ ## Settings
75
+
76
+ In the control panel (*Backgammon*, under Everyday): the game on now or the saved one, start it on
77
+ the device, start over, stop – and **Your dice** (on the screen, or real dice you tell Emkay about),
78
+ **Show pictures** and **Layout** (`auto`, `portrait`, `landscape`).
79
+
80
+ ## For developers
81
+
82
+ The rules and Emkay's play (`engine.py`) are plain Python with no OVOS in it:
83
+ `Game(new_game(), words).handle("roll")`; `plays(start(), [6, 1])` lists every legal way to play a
84
+ roll. The game is a small dict that is saved as JSON. The words of each language are in
85
+ `locale/<lang>/backgammon.json`; spoken numbers are in `spoken_numbers.py`. `boardgame.py` is what
86
+ every board game of emkay-voice does the same way.
87
+
88
+ ## Languages
89
+
90
+ Catalan, Danish, Dutch, English, French, Galician, German, Italian, Norwegian (bokmål), Portuguese
91
+ (Brazil and Portugal, where it is *Gamão*), Spanish, Swedish and Basque. Everything except English
92
+ and Danish is machine translated and only loosely read through by a native Dane – corrections are
93
+ very welcome.
94
+
95
+ ## Category
96
+
97
+ **Entertainment**
98
+
99
+ ## Tags
100
+
101
+ #game #boardgame #backgammon #dice #emkay
102
+
103
+ ## License
104
+
105
+ Apache-2.0. Made by [emkay-voice](https://github.com/emkay-voice), maintained by Andreas Lorensen.
@@ -0,0 +1,71 @@
1
+ # Copyright 2026 emkay-voice
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """Backgammon against Emkay, by voice.
16
+
17
+ "Play backgammon" - the points are numbered 1 to 24 from your side, so a
18
+ move is just "13 to 7"; "bar to 22", "6 off". Say roll, or the two numbers
19
+ you rolled on real dice. Emkay rolls its own dice on the screen and says
20
+ its moves in the same numbers - play on the screen, or on your own board
21
+ and move Emkay's checkers as it says. Easy, normal and hard. The game is
22
+ saved as you go - also for your other devices with My Emkay. Made for
23
+ Emkay, works on any OpenVoiceOS."""
24
+ from .boardgame import BoardGameSkill, normalize
25
+ from .engine import EMKAY, YOU, Game, new_game, pips, state
26
+ from .picture import compose
27
+
28
+
29
+ class BackgammonSkill(BoardGameSkill):
30
+ WORDS = "backgammon.json"
31
+ VOC = "backgammon_skill"
32
+ BUS = "backgammon"
33
+ URI = "backgammon:game"
34
+ ICON = "https://raw.githubusercontent.com/emkay-voice/ovos-skill-backgammon/main/icon.png"
35
+ BACKGROUND = "#12161c"
36
+ DEFAULTS = {"pictures": True, "layout": "auto", "dice": "screen"}
37
+
38
+ def _said(self, utterance, key):
39
+ said = f" {normalize(utterance)} "
40
+ return any(f" {normalize(w)} " in said for w in self._words().get(key, []))
41
+
42
+ def _choice(self, utterance, key):
43
+ said = f" {normalize(utterance)} "
44
+ for name, spoken in self._words().get(key, {}).items():
45
+ if any(f" {normalize(w)} " in said for w in spoken):
46
+ return name
47
+ return None
48
+
49
+ def wants_new(self, utterance):
50
+ return bool(utterance) and bool(self._choice(utterance, "levels") or self._said(utterance, "emkay_first")
51
+ or self._said(utterance, "real_dice") or self._said(utterance, "screen_dice"))
52
+
53
+ def new_game(self, utterance=""):
54
+ real = self.setting("dice") == "real"
55
+ if utterance and self._said(utterance, "real_dice"):
56
+ real = True
57
+ if utterance and self._said(utterance, "screen_dice"):
58
+ real = False
59
+ first = EMKAY if utterance and self._said(utterance, "emkay_first") else YOU
60
+ return new_game(self._choice(utterance, "levels") or "normal", first, real)
61
+
62
+ def make_game(self, g):
63
+ return Game(g, self._words())
64
+
65
+ def picture(self, game, portrait):
66
+ return compose(game.g, game.words, game.words["title"], portrait=portrait)
67
+
68
+ def panel_status(self, g):
69
+ words = self._words()
70
+ you, me = pips(state(g))
71
+ return {"pips": f"{you} – {me}", "dice_kind": words.get("cp_dice", {}).get("real" if g.get("real") else "screen", "")}