szabgab / wis-python-course-2024-04

16 stars 9 forks source link

day08 Assignment - Shaked Levy #219

Closed LevyShaked closed 3 months ago

LevyShaked commented 3 months ago

https://github.com/LevyShaked/Assignments_rep/tree/main/day08

Thanks, Shaked

szabgab commented 3 months ago

It would be much better if all the information appeared in the GUI and nothing on the command line. Also, when I close the windows with the top-right x then I got a nasty error message:

$ python guessing_gui.py 

Find the number I choose! (Between 1 to 20) 

    Your score includes the time t and the number of trials counter. For instance: 
    counter=1, t=1 : score = 100 
    counter=3, t=10 : score = 96 
    counter=6, t=12 : score = 70 
    counter=20, any t : score = 0 

so it's important to think fast, but luck and strategy are better! 

Sorry ): , your guess is BIGGER than the number 
        try again
Sorry ): , your guess is SMALLER than the number 
        try again
Traceback (most recent call last):
  File "/home/gabor/Weizmann-2024-04/Shaked-Levy/day08/guessing_gui.py", line 191, in <module>
    main()
  File "/home/gabor/Weizmann-2024-04/Shaked-Levy/day08/guessing_gui.py", line 54, in main
    yes_or_else_loopa(counter, num)
  File "/home/gabor/Weizmann-2024-04/Shaked-Levy/day08/guessing_gui.py", line 82, in yes_or_else_loopa
    game(counter, num)
  File "/home/gabor/Weizmann-2024-04/Shaked-Levy/day08/guessing_gui.py", line 69, in game
    elif int(guess) == num:
         ^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'