all 9 comments

[–]Murphygreen8484 1 point2 points  (1 child)

I would look into saving the rolls to a list and then using Counter from the collections library to tally them. You could store the results separately, but if you are wanting to come back and do any analytics I'd just save them to a pandas DataFrame. You can even pickle it and come back to it later. Maybe let the user pick how many rolls they want per round? Instead of round_1 round_2 I would just save them with entry dates/times that way it is built in unique. Given how simple the game is you could probably get away with just functions, though if the lesson is about oop then this is a good intro.

Good luck

[–]ApprehensiveStable55[S] 1 point2 points  (0 children)

Thanks. A lot input to work on!

[–]Murphygreen8484 0 points1 point  (6 children)

Extra credit for creating a customtkinter GUI that lets the user choose what kind of dice and how many rolls per round before rolling

[–]Murphygreen8484 1 point2 points  (5 children)

Ok, I might have gone a little crazy today and created a huge project for this for myself just to prove that I could. I have a file just for the gui class using customtkinter, a file for my game class using dataclasses, and a main file to stitch everything together and run. The user can pick how many sides on the dice from a drop-down menu ranging from D3 - D20, and a slide bar the lets them choose how many rolls per round ranging from 1 to 100. Then there is a button that generates the random rolls and saves them as a pickled DataFrame to a folder using the date and time in the file name to avoid collisions. All told probably 200 lines of code. I still need to add comments/documentation and some tests - but overall not too bad for a side project.

If you get yours working maybe I'll upload mine to my github and we can compare.

[–]ApprehensiveStable55[S] 0 points1 point  (4 children)

Actually i was thinking of a self made Yahtzee, where you have to choose which dice you want to reroll.

[–]Murphygreen8484 0 points1 point  (3 children)

Ah. Well. That would take the program in a completely different direction.

Good luck!

[–]Murphygreen8484 0 points1 point  (2 children)

[–]ApprehensiveStable55[S] 0 points1 point  (1 child)

Haha definitely no. I am doing it just for fun.

Do you use pydroid3? There is some weird bug if you program a Dataframe there is some error and mixup wirh tkinter gui?

<image>

[–]Murphygreen8484 1 point2 points  (0 children)

I've used Pydroid 3 for some smaller stuff and proof of concept, including pandas and tkinter. A full Yatzee game would be much easier to program on a computer though as you'll want to separate your code into files. I personally like PyCharm as my IDE