Introduction |
|
1 | (6) |
|
|
2 | (2) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
5 | (2) |
|
Part I The Most Basic Building Blocks |
|
|
7 | (62) |
|
Project 1 Getting Started with Ruby |
|
|
9 | (24) |
|
|
10 | (2) |
|
|
12 | (1) |
|
|
12 | (21) |
|
|
13 | (10) |
|
|
23 | (10) |
|
|
33 | (14) |
|
Starting Interactive Ruby |
|
|
34 | (2) |
|
|
36 | (1) |
|
|
37 | (1) |
|
Supersizing the Math with Huge Numbers |
|
|
38 | (1) |
|
Adding Memory by Storing Results in Variables |
|
|
39 | (2) |
|
Using Variables to Repeat a Calculation |
|
|
41 | (1) |
|
Fixing Things When Something Goes Wrong |
|
|
42 | (3) |
|
|
45 | (2) |
|
Project 3 Bigger Hello World |
|
|
47 | (22) |
|
Starting Interactive Ruby |
|
|
48 | (1) |
|
Knowing How Letters and Words Differ from Numbers |
|
|
48 | (2) |
|
|
50 | (1) |
|
Doing Other Things with Strings |
|
|
51 | (2) |
|
Storing Strings in Variables |
|
|
53 | (1) |
|
|
54 | (13) |
|
An easy way to combine words |
|
|
55 | (1) |
|
An advanced way to combine strings together |
|
|
56 | (1) |
|
|
57 | (2) |
|
|
59 | (2) |
|
|
61 | (1) |
|
|
62 | (1) |
|
Combining the letters into a word |
|
|
63 | (4) |
|
|
67 | (2) |
|
Part II Programmers Are Lazy! Stop Typing So Much! |
|
|
69 | (74) |
|
|
71 | (24) |
|
|
72 | (3) |
|
Printing versus Using puts |
|
|
75 | (1) |
|
|
76 | (1) |
|
Running the Program on the Command Line |
|
|
77 | (3) |
|
Creating Code to Draw a Rectangle |
|
|
80 | (7) |
|
A first version of the rectangle |
|
|
81 | (3) |
|
|
84 | (3) |
|
Creating Code to Draw a Triangle |
|
|
87 | (3) |
|
Drawing a House Using Your Two Shapes |
|
|
90 | (2) |
|
|
92 | (1) |
|
|
93 | (2) |
|
Project 5 Simple Adventure |
|
|
95 | (22) |
|
|
96 | (1) |
|
|
97 | (1) |
|
Looking at the Program Skeleton |
|
|
98 | (3) |
|
Creating the Main Game Loop |
|
|
101 | (6) |
|
Creating the room description and actions |
|
|
102 | (2) |
|
Responding to player actions |
|
|
104 | (3) |
|
Creating Game Rules Methods |
|
|
107 | (7) |
|
Adding methods needed for the move command |
|
|
108 | (3) |
|
Adding methods for handling the fighting monster |
|
|
111 | (1) |
|
Adding methods for treasure searches |
|
|
112 | (2) |
|
Creating Game Helper Methods |
|
|
114 | (2) |
|
|
116 | (1) |
|
Project 6 Number Guessing |
|
|
117 | (26) |
|
|
118 | (1) |
|
|
119 | (1) |
|
Looking at the Program Skeleton |
|
|
120 | (4) |
|
Creating Placeholder Classes |
|
|
124 | (5) |
|
Creating an empty Game class |
|
|
125 | (1) |
|
Creating an empty Player class |
|
|
125 | (2) |
|
Adding the missing initialize to the Game class |
|
|
127 | (2) |
|
|
129 | (4) |
|
Creating player getter methods |
|
|
129 | (2) |
|
Creating player setter methods |
|
|
131 | (1) |
|
Adding player utility methods |
|
|
131 | (2) |
|
Writing the Game Class Code |
|
|
133 | (7) |
|
Coding the Game class getters |
|
|
133 | (1) |
|
|
134 | (2) |
|
Running the guessing loop |
|
|
136 | (1) |
|
|
137 | (2) |
|
|
139 | (1) |
|
Showing the player the results |
|
|
139 | (1) |
|
|
140 | (3) |
|
Part III Working with Lots of Your Own Data |
|
|
143 | (80) |
|
|
145 | (24) |
|
|
146 | (1) |
|
|
147 | (1) |
|
Looking at the Program Skeleton |
|
|
148 | (3) |
|
Creating Placeholder Classes |
|
|
151 | (4) |
|
Creating an empty Game class |
|
|
151 | (2) |
|
Creating an empty Player class |
|
|
153 | (1) |
|
Creating an empty Straw class |
|
|
154 | (1) |
|
|
155 | (4) |
|
Creating straw getter methods |
|
|
155 | (1) |
|
Creating the straw factory method |
|
|
156 | (2) |
|
|
158 | (1) |
|
Coding the Player Methods |
|
|
159 | (3) |
|
Creating player getters and setters |
|
|
159 | (2) |
|
Creating player helper methods |
|
|
161 | (1) |
|
|
162 | (5) |
|
Code initialization and the end condition |
|
|
162 | (1) |
|
Code user interface methods |
|
|
163 | (2) |
|
Coding the main game logic methods |
|
|
165 | (2) |
|
|
167 | (2) |
|
|
169 | (26) |
|
|
170 | (1) |
|
|
170 | (4) |
|
Seeing how the Caesar cipher works |
|
|
171 | (2) |
|
Looking at the program skeleton |
|
|
173 | (1) |
|
Creating Placeholder Classes |
|
|
174 | (2) |
|
|
174 | (2) |
|
|
176 | (1) |
|
Coding CodeBreaker Methods |
|
|
176 | (9) |
|
The CodeBreaker run method |
|
|
176 | (1) |
|
|
177 | (5) |
|
Encryption and decryption methods |
|
|
182 | (3) |
|
|
185 | (8) |
|
|
185 | (4) |
|
|
189 | (1) |
|
Encryption and decryption methods |
|
|
190 | (3) |
|
|
193 | (2) |
|
|
195 | (28) |
|
|
196 | (1) |
|
|
196 | (4) |
|
Looking at the Program Skeleton |
|
|
200 | (3) |
|
|
203 | (17) |
|
|
203 | (3) |
|
|
206 | (2) |
|
Creating the player class |
|
|
208 | (3) |
|
|
211 | (9) |
|
|
220 | (3) |
|
Part IV Using Shared Code to Get Graphical |
|
|
223 | (84) |
|
|
225 | (30) |
|
|
226 | (1) |
|
|
227 | (3) |
|
Looking at the Program Skeleton |
|
|
230 | (2) |
|
Creating Placeholder Classes |
|
|
232 | (8) |
|
|
233 | (1) |
|
|
234 | (3) |
|
|
237 | (2) |
|
|
239 | (1) |
|
|
240 | (1) |
|
|
240 | (3) |
|
|
243 | (5) |
|
|
248 | (3) |
|
|
251 | (1) |
|
|
252 | (3) |
|
|
255 | (26) |
|
|
256 | (1) |
|
|
257 | (1) |
|
Looking at the Program Skeleton |
|
|
258 | (2) |
|
Creating Placeholder Classes |
|
|
260 | (8) |
|
|
261 | (3) |
|
|
264 | (2) |
|
|
266 | (2) |
|
|
268 | (4) |
|
|
272 | (2) |
|
|
274 | (3) |
|
|
277 | (4) |
|
|
281 | (26) |
|
|
282 | (1) |
|
|
283 | (1) |
|
Looking at the Program Skeleton |
|
|
284 | (2) |
|
Creating Placeholder Classes |
|
|
286 | (8) |
|
|
287 | (2) |
|
|
289 | (3) |
|
|
292 | (2) |
|
|
294 | (1) |
|
|
295 | (4) |
|
|
299 | (6) |
|
Programming the user interface |
|
|
299 | (1) |
|
|
300 | (4) |
|
Adding more seed patterns |
|
|
304 | (1) |
|
|
305 | (2) |
Index |
|
307 | |