Skip to content

Commit

Permalink
bugfix: Use same index for Prose Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
KappaDistributive committed May 12, 2024
1 parent a38e008 commit f7a9cbf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions v1/selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ func createSelection(cursorPos int) Selection {
content.Rows = append(content.Rows, lesson.Title)
}

lessons[1].Title = "Random Prose - " + lessons[rand.Intn(len(lessons)-2)+2].Title
lessons[1].Content = lessons[rand.Intn(len(lessons)-2)+2].Content
random_index := rand.Intn(len(lessons)-2) + 2
lessons[1].Title = "Random Prose - " + lessons[random_index].Title
lessons[1].Content = lessons[random_index].Content

content.SetRect(MainMinX, MainMinY, MainMaxX, MainMaxY)
content.SelectedRowStyle = ui.NewStyle(ui.ColorGreen)
Expand Down

0 comments on commit f7a9cbf

Please sign in to comment.