Fix day checking
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Jake 2022-01-24 09:11:03 +00:00
parent f596b23055
commit dbfbf0efa2
2 changed files with 6 additions and 4 deletions

View File

@ -12,9 +12,10 @@ and [Lip Gloss](https://github.com/charmbracelet/lipgloss).
## Features
- [x] Statistics are saved to `~/.wordle.json` for use in other programs.
- [x] Same word list as the official website.
- [x] Statistics are saved to `~/.wordle.json` for use in other programs
- [x] Same word list as the official website
- [ ] Leaderboard of people on current tilde
- [ ] Update checking
- [ ] Export to sharable message/emojis
- [ ] Share to Mastodon
- [ ] Play previous days

View File

@ -19,7 +19,8 @@ type model struct {
func initialModel() model {
m := model{
board: game.NewBoard(),
board: game.NewBoard(),
buffer: []rune{},
}
lastGame, err := score.GetLastGame()
@ -28,7 +29,7 @@ func initialModel() model {
return m
}
if lastGame != nil {
if lastGame != nil && lastGame.Day == m.board.Day {
m.error = fmt.Sprintf("Come back tomorrow for a new word")
m.board = &game.Board{
Guesses: [6]game.Guess{},