1 00:00:00,000 --> 00:00:04,747 [MUSIC] 2 00:00:04,747 --> 00:00:08,280 Let's practice some basic Ruby to make sure that everything that you've learned 3 00:00:08,280 --> 00:00:08,952 so far sticks. 4 00:00:08,952 --> 00:00:12,560 We'll review variables, as well as simple input and output. 5 00:00:12,560 --> 00:00:14,210 If you're not familiar with these topics, 6 00:00:14,210 --> 00:00:18,530 check the Teacher's Notes attached to this video for links where you can learn more. 7 00:00:18,530 --> 00:00:22,110 We're going to ask you to build a simple Ruby program. 8 00:00:22,110 --> 00:00:25,440 Your program will play a fill-in-the-blank word game with the user. 9 00:00:25,440 --> 00:00:30,230 You'll prompt them for a noun, a verb, and so forth, just like this. 10 00:00:30,230 --> 00:00:31,953 So please enter a verb, jump. 11 00:00:31,953 --> 00:00:33,819 Please enter a noun, desk. 12 00:00:33,819 --> 00:00:35,454 Please enter an adjective. 13 00:00:35,454 --> 00:00:36,877 Let's say, quick. 14 00:00:36,877 --> 00:00:38,317 And another noun. 15 00:00:38,317 --> 00:00:39,880 Let's say, can. 16 00:00:39,880 --> 00:00:43,592 Then you'll use those stored words to fill in blanks in several sentences and 17 00:00:43,592 --> 00:00:45,373 print the completed sentences out. 18 00:00:45,373 --> 00:00:48,012 The resulting story will probably sound a little silly, and 19 00:00:48,012 --> 00:00:49,728 that's exactly the point of the game. 20 00:00:49,728 --> 00:00:54,207 It's pretty simple but it combines several fundamental programming steps. 21 00:00:54,207 --> 00:00:57,390 The formatting on your printed story may look a little strange. 22 00:00:57,390 --> 00:00:59,940 Don't worry about that while you're coding your solution. 23 00:00:59,940 --> 00:01:03,942 When I show you my solution, I'll also show you a new method you can go back and 24 00:01:03,942 --> 00:01:06,049 add to your program to clean up the output. 25 00:01:06,049 --> 00:01:08,355 I've attached a workspace to this video, 26 00:01:08,355 --> 00:01:12,790 which includes a game.rb starter file with instructions as Ruby comments. 27 00:01:12,790 --> 00:01:14,100 You should open the workspace now. 28 00:01:15,270 --> 00:01:19,310 You can either use our in-browser editor, or you can choose Download Workspace from 29 00:01:19,310 --> 00:01:22,040 the File menu, if you have Ruby installed on your computer. 30 00:01:23,170 --> 00:01:26,440 Write your code in the game.rb file and save your work. 31 00:01:26,440 --> 00:01:31,649 Then, switch to the terminal and type ruby game.rb. 32 00:01:31,649 --> 00:01:33,790 That will run your completed game. 33 00:01:33,790 --> 00:01:36,940 The game should begin prompting for words and print your story when it's done. 34 00:01:38,010 --> 00:01:40,288 I've linked to some videos in the Teacher's Notes, 35 00:01:40,288 --> 00:01:41,967 which you can refer to if you get stuck. 36 00:01:41,967 --> 00:01:43,827 After you've written your program, 37 00:01:43,827 --> 00:01:47,900 you can proceed to the next video where you can compare my solution to yours. 38 00:01:47,900 --> 00:01:48,450 Ready? 39 00:01:48,450 --> 00:01:49,830 Get started on your program. 40 00:01:49,830 --> 00:01:51,670 I'll show you my version in the next video.