File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11SONNET 29
22WILLIAM SHAKESPEARE
33
4- WHEN, IN DISGRACE WITH FORTUNE AND MEN’ S EYES,
4+ WHEN, IN DISGRACE WITH FORTUNE AND MEN' S EYES,
55I ALL ALONE BEWEEP MY OUTCAST STATE,
66AND TROUBLE DEAF HEAVEN WITH MY BOOTLESS CRIES,
77AND LOOK UPON MYSELF AND CURSE MY FATE,
88WISHING ME LIKE TO ONE MORE RICH IN HOPE,
99FEATURED LIKE HIM, LIKE HIM WITH FRIENDS POSSESSED,
10- DESIRING THIS MAN’ S ART AND THAT MAN’ S SCOPE,
10+ DESIRING THIS MAN' S ART AND THAT MAN' S SCOPE,
1111WITH WHAT I MOST ENJOY CONTENTED LEAST;
1212YET IN THESE THOUGHTS MYSELF ALMOST DESPISING,
1313HAPLY I THINK ON THEE, AND THEN MY STATE,
1414(LIKE TO THE LARK AT BREAK OF DAY ARISING
15- FROM SULLEN EARTH) SINGS HYMNS AT HEAVEN’ S GATE;
15+ FROM SULLEN EARTH) SINGS HYMNS AT HEAVEN' S GATE;
1616FOR THY SWEET LOVE REMEMBERED SUCH WEALTH BRINGS
1717THAT THEN I SCORN TO CHANGE MY STATE WITH KINGS.
Original file line number Diff line number Diff line change @@ -28,16 +28,15 @@ def main() -> None:
2828 elif state .winner :
2929 print (f'{ state .winner } has won!' )
3030 break
31-
32- state = get_move (state )
33-
34- if state .quit :
31+ elif state .quit :
3532 print ('You lose, loser!' )
3633 break
3734 elif state .draw :
3835 print ("All right, we'll call it a draw." )
3936 break
4037
38+ state = get_move (state )
39+
4140
4241# --------------------------------------------------
4342def get_move (state : State ) -> State :
Original file line number Diff line number Diff line change @@ -33,16 +33,15 @@ def main() -> None:
3333 elif state ['winner' ]:
3434 print (f"{ state ['winner' ]} has won!" )
3535 break
36-
37- state = get_move (state )
38-
39- if state ['quit' ]:
36+ elif state ['quit' ]:
4037 print ('You lose, loser!' )
4138 break
4239 elif state ['draw' ]:
4340 print ('No winner.' )
4441 break
4542
43+ state = get_move (state )
44+
4645
4746# --------------------------------------------------
4847def get_move (state : State ) -> State :
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ https://www.youtube.com/playlist?list=PLhOuww6rJJNNx06soCkb4aMFhuioQ7tY5
44
55This is a collection of example programs to show how you can use the standard Python module ` argparse ` to handle command-line aruguments.
66
7- * ` sys_argv.py ` : sys.argv
87* ` one_arg.py ` : one positional argument
98* ` two_args.py ` : two positional arguments
109* ` nargs2.py ` : another way to handle two positional arguments
Original file line number Diff line number Diff line change 11Sonnet 29
22William Shakespeare
33
4- When, in disgrace with fortune and men’ s eyes,
4+ When, in disgrace with fortune and men' s eyes,
55I all alone beweep my outcast state,
66And trouble deaf heaven with my bootless cries,
77And look upon myself and curse my fate,
88Wishing me like to one more rich in hope,
99Featured like him, like him with friends possessed,
10- Desiring this man’ s art and that man’ s scope,
10+ Desiring this man' s art and that man' s scope,
1111With what I most enjoy contented least;
1212Yet in these thoughts myself almost despising,
1313Haply I think on thee, and then my state,
1414(Like to the lark at break of day arising
15- From sullen earth) sings hymns at heaven’ s gate;
15+ From sullen earth) sings hymns at heaven' s gate;
1616For thy sweet love remembered such wealth brings
1717That then I scorn to change my state with kings.
You can’t perform that action at this time.
0 commit comments