borse 0.1.0__py3-none-any.whl → 0.2.0__py3-none-any.whl

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.
borse/__about__.py CHANGED
@@ -1,3 +1,3 @@
1
- __version__ = "0.1.0"
1
+ __version__ = "0.2.0"
2
2
  __author__ = "Evan Chen"
3
3
  __license__ = "MIT"
borse/game.py CHANGED
@@ -119,20 +119,28 @@ class Game:
119
119
  ]
120
120
 
121
121
  while True:
122
- row = self.draw_title("BORSE - Code Practice Game")
122
+ row = self.draw_title("BORSE - Braille mORse SEmaphore, by vEnhance")
123
123
  height, _ = self.stdscr.getmaxyx()
124
124
 
125
- # Show today's progress
125
+ # Show today's progress and all-time total
126
126
  today = self.progress.get_today()
127
+ alltime = self.progress.get_alltime_by_mode()
127
128
  progress_text = (
128
129
  f"Today: {today.total_words} words "
129
130
  f"(B:{today.braille_words} M:{today.morse_words} "
130
131
  f"S:{today.semaphore_words} A:{today.a1z26_words})"
131
132
  )
133
+ alltime_text = (
134
+ f"All-time: {alltime.total_words} words "
135
+ f"(B:{alltime.braille_words} M:{alltime.morse_words} "
136
+ f"S:{alltime.semaphore_words} A:{alltime.a1z26_words})"
137
+ )
132
138
  try:
133
139
  if curses.has_colors():
134
140
  self.stdscr.attron(curses.color_pair(3))
135
141
  self.stdscr.addstr(row, 2, progress_text)
142
+ row += 1
143
+ self.stdscr.addstr(row, 2, alltime_text)
136
144
  if curses.has_colors():
137
145
  self.stdscr.attroff(curses.color_pair(3))
138
146
  except curses.error:
borse/progress.py CHANGED
@@ -90,6 +90,27 @@ class Progress:
90
90
  self.daily[today] = DailyProgress()
91
91
  return self.daily[today]
92
92
 
93
+ def get_alltime_total(self) -> int:
94
+ """Get total words answered across all days.
95
+
96
+ Returns:
97
+ Sum of all words across all days.
98
+ """
99
+ return sum(day.total_words for day in self.daily.values())
100
+
101
+ def get_alltime_by_mode(self) -> DailyProgress:
102
+ """Get all-time totals broken down by mode.
103
+
104
+ Returns:
105
+ DailyProgress with summed values across all days.
106
+ """
107
+ return DailyProgress(
108
+ morse_words=sum(day.morse_words for day in self.daily.values()),
109
+ braille_words=sum(day.braille_words for day in self.daily.values()),
110
+ semaphore_words=sum(day.semaphore_words for day in self.daily.values()),
111
+ a1z26_words=sum(day.a1z26_words for day in self.daily.values()),
112
+ )
113
+
93
114
  def add_word(self, mode: str) -> None:
94
115
  """Add a completed word for today.
95
116
 
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: borse
3
- Version: 0.1.0
4
- Summary: A terminal game for practicing Morse code, Braille, and semaphore.
3
+ Version: 0.2.0
4
+ Summary: Practice braille, Morse, semaphore.
5
5
  Project-URL: repository, https://github.com/vEnhance/borse
6
6
  Author-email: Evan Chen <evan@evanchen.cc>
7
7
  License: MIT
@@ -29,13 +29,12 @@ Or you can install from PyPI by using `uv`, `pip`, etc.
29
29
 
30
30
  ## Configuration
31
31
 
32
- Configuration is stored in `~/.config/borse/config.json` by default:
32
+ Configuration is stored in `~/.config/borse/config.toml` by default, e.g.
33
33
 
34
- ```json
35
- {
36
- "progress_file": "~/.config/borse/progress.json",
37
- "words_per_game": 10
38
- }
34
+ ```toml
35
+ progress_file = "/home/evan/.config/borse/progress.json"
36
+ words_per_game = 10
37
+ single_letter_probability = 0.3
39
38
  ```
40
39
 
41
40
  Your daily progress is also automatically saved and displayed on the main menu.
@@ -116,10 +115,10 @@ Set up by cloning the repository and running
116
115
 
117
116
  ```bash
118
117
  uv sync
119
- uv run prek install
118
+ uv run prek install # pre-commit hooks
120
119
  ```
121
120
 
122
- To manually run the linter and tests
121
+ To manually run the linter and tests:
123
122
 
124
123
  ```bash
125
124
  uv run prek --all-files # run linter
@@ -1,17 +1,17 @@
1
1
  borse/WORDS.txt,sha256=eEjDg7tmTgtFzhQMQrSNx58UdPpPmnax7JZIHjRGA5g,40575
2
- borse/__about__.py,sha256=0zET0Hr7ZlMR2QzPnTxlIVERltHMYywiz05ap-993o8,67
2
+ borse/__about__.py,sha256=g5qw0caFJh2-7xXbEXwcVoVjcpswDiDdFojVMcRa4As,67
3
3
  borse/__init__.py,sha256=M5ARPgePzj8zEaqyk11jzt0RtDD5nbhA2KPS31vGJRk,109
4
4
  borse/a1z26.py,sha256=BmkTTxeCu4fvjFRMDSZktJWu0E169H32uga1khkl7gY,964
5
5
  borse/braille.py,sha256=h1q_r_4Am3_RswL3gqsa5Mm076RU0vSY7TSsQ72ExZQ,2642
6
6
  borse/config.py,sha256=eUDNRkxTIQRRpCnm9P3tQgFKjS4f2MF5-lNZFtt78Jg,3695
7
- borse/game.py,sha256=h_vLIRk-AX0FeHiL9y5UCj-1QyJW2iSOCFFPWjUvOnA,17278
7
+ borse/game.py,sha256=7gqwBYGJfQvsBv_0f2EpN-vqEn8-0_tlPochFnfy1IE,17699
8
8
  borse/main.py,sha256=peNdARRdBjtCP0rg2_hjq1GRkESWQhfxxAuGMYxyCkw,535
9
9
  borse/morse.py,sha256=nh7ptvXaoIHoUN_eval0-nZRd4oWyDNpDdnxsclx9F0,1818
10
- borse/progress.py,sha256=CPsv5SMF4ulHKbZu95_qK2_kpR1_BX1OFWChSoiKl44,4390
10
+ borse/progress.py,sha256=Ba293Z7pzl5g6L8y4gePMAaJM3rC7XkIpff8An_vVMs,5184
11
11
  borse/semaphore.py,sha256=mdU1siRkW4eAAgtCuSdc7aMCr2-DbZOwgmzpGnism8I,3855
12
12
  borse/words.py,sha256=3YifBii9OuMI2eHXAtvENxVM5n0T4eyZTU-NJ7EPmtQ,1023
13
- borse-0.1.0.dist-info/METADATA,sha256=LRsX8A7DmCJIa6pFCisk_MGg7KDhS3ybCPHea6ASnOg,4175
14
- borse-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
15
- borse-0.1.0.dist-info/entry_points.txt,sha256=e3JYLL_H22Xgqe3_TyecetryyyE2kt07nBOGz4T41Ic,42
16
- borse-0.1.0.dist-info/licenses/LICENSE,sha256=gq-dD45uKs1sNrFCbrHXC8PpsWoSauIPzU-NEQHmTEc,1066
17
- borse-0.1.0.dist-info/RECORD,,
13
+ borse-0.2.0.dist-info/METADATA,sha256=e2ag04jhjzdylDPsaeDlmJB9Zb_DoPbCv0SVa56BOlw,4199
14
+ borse-0.2.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
15
+ borse-0.2.0.dist-info/entry_points.txt,sha256=e3JYLL_H22Xgqe3_TyecetryyyE2kt07nBOGz4T41Ic,42
16
+ borse-0.2.0.dist-info/licenses/LICENSE,sha256=gq-dD45uKs1sNrFCbrHXC8PpsWoSauIPzU-NEQHmTEc,1066
17
+ borse-0.2.0.dist-info/RECORD,,
File without changes