-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathreadme.html
120 lines (120 loc) · 3.91 KB
/
readme.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=yes"
/>
<title>readme</title>
<style type="text/css">
code {
white-space: pre-wrap;
}
span.smallcaps {
font-variant: small-caps;
}
span.underline {
text-decoration: underline;
}
div.column {
display: inline-block;
vertical-align: top;
width: 50%;
}
</style>
</head>
<body>
<h1 id="practice-exercises-for-problem-solving">
Practice Exercises for problem solving
</h1>
<h2 id="overview">Overview</h2>
<p>
In this section, you’ll have a chance to practice the concepts you’ve
learned in the videos. First, review the core concepts covered that you’ll
need to keep in mind. Then go through the exercises below.
</p>
<p>
Remember, these are for your own benefit. Feel free to skip them if you
don’t find a particular exercise valuable or you get stuck for too long.
</p>
<h2 id="core-concepts">Core concepts</h2>
<h3 id="michaels-problem-solving-techniques">
Michael’s problem solving techniques
</h3>
<p>
Here are a few of the ideas I use to get traction while solving a problem
</p>
<ol type="1">
<li>Divide and conquer.</li>
<li>Have I seen a similar problem before?</li>
<li>
Visualize the data (<a href="http://pythontutor.com">pythontutor.com</a
>, debugger, <code>print()</code>, etc)
</li>
<li>
Run through the data structures (will a well known data structure help
this problem?).
</li>
<li>
Is there a <a href="https://pypi.org/">PyPI</a> package that solves
this? Also check
<a href="https://awesome-python.com/">awesome-python</a>.
</li>
<li>Remember this is <strong>part of the journey</strong>.</li>
<li>
<strong>Just start</strong>, you can adjust as you go and learn more.
</li>
</ol>
<h2 id="exercises">Exercises</h2>
<p>
Now it’s your turn. For this round, you get to dive into a similar
experience as we had building
<a
href="https://www.google.com/search?client=firefox-b-1-d&q=Tic+Tac+Toe"
><strong>Tic Tac Toe</strong></a
>
in the videos.
</p>
<p><img src="readme_files/Connect_4_Board_and_Box.jpg" /></p>
<p>
You get to build a <strong>Connect 4</strong> clone. Read more about the
game
<strong
><a href="https://en.wikipedia.org/wiki/Connect_Four"
>on Wikipedia</a
></strong
>
or try a few rounds over at
<strong
><a href="https://www.mathsisfun.com/games/connect4.html"
>this website</a
></strong
>.
</p>
<p>
It should be pretty similar to tic tac toe. But the way a player selects a
play is just to choose the column and the state of the board determines
which row the puck stops in. Also, you do not need an entire row, column,
or diagonal to win, just 4 of a given kind in any of these.
</p>
<p>
Think about what you saw in the videos (<strong
>#2, have I seen a similar solution</strong
>), use the right data structure (<strong
>#4, Run through the data structures</strong
>), and as always, break the problem down to simple parts (<strong
>#1, Divide and conquer</strong
>).
</p>
<p>
Also, remember that writing this program is involved. Most likely, it
won’t be super fast to solve (<strong
>#6, this is part of the journey</strong
>). Now, create a new blank project and start coding (<strong
>#7, just start</strong
>)!
</p>
</body>
</html>