Locked lesson.
About this lesson
Let's use what we've learned to build a math flashcard game!
Exercise files
Download this lesson’s related exercise files.
Building a Flashcard Game - Solution.docx60.8 KB Building a Flashcard Game.docx
59.1 KB
Quick reference
Building a Flashcard Game
Let's build a math flashcard game!
When to use
This is a fun little app that let's us use some of the skills we just learned.
Instructions
Before starting any new project, create a list of the steps you'll need to follow:
- math flashcards
- have a menu
- do adding, subtracting, multiplication or division?
- show math problem
- get the users input
- check the input (answer) vs the correct answer
- output whether they got the answer right or wrong
- ask if they want to play again
- show menu or end game
Hints & tips
- Always write out a quick list of things to do for your new app!
- 00:04 We've come to the end of the course and now it's time to put everything we've
- 00:08 learned together and kind of make a little fun math flashcard app.
- 00:11 Just to sort of reinforce some of the stuff we learned, and
- 00:14 use our new skills and have a little bit of fun.
- 00:16 So, it's some pretty simple program, but it's going to allow us to use a lot of
- 00:19 the concepts that we talked about throughout the course.
- 00:22 Maybe it's been a while since you watched those videos.
- 00:24 They're starting to fade a little bit from your memory.
- 00:26 It's a good idea to build something and
- 00:27 reinforce those things that you've just learned.
- 00:30 So, that's what we're going to do starting in this video and the next few videos.
- 00:33 So what are we going to build?
- 00:35 Well, it's just going to be a very, very simple math flashcard app and so,
- 00:39 what is one plus seven, eight?
- 00:41 Correct?
- 00:42 Or what is four plus one, 98, wrong.
- 00:47 And so, we want to be able to do that for addition, subtraction, multiplication and
- 00:51 division and we want to create a little menu so
- 00:53 that when somebody starts the game, it prompts them, would you like a addition,
- 00:57 subtraction, multiplication or division flashcard?
- 01:00 And they can choose from the menu and then it'll run the thing, and then afterwards,
- 01:04 it'll say would you like to play again and show the menu again and
- 01:07 that sort of thing.
- 01:08 So just a simple little fun game, not practically useful for anything.
- 01:12 Like I said, it'll allow us to use some of the stuff that we've learned and
- 01:16 having neat little project to show for your time in taking this course.
- 01:19 So whenever I create a new program, the first thing I do is just sort of map out
- 01:24 what I want to do and it's a good idea, we haven't really talked about this
- 01:28 throughout the course, we just sort of started writing code.
- 01:31 But even if you're going to build a simple program,
- 01:34 it's a good idea to just spend a couple of minutes.
- 01:36 And really, on a piece of paper or in a notepad on your computer,
- 01:40 just make a list of steps involved in what you want to build.
- 01:44 It goes a long way in making it easier to build your program.
- 01:48 The more complicated your program is, the more you're going to rely on this list.
- 01:52 because you might be working on something for a week, a month, even a year, and
- 01:55 you kind of lose track of what you're doing.
- 01:57 And then you can refer back to your list and go, yeah, I wanted to do this, and
- 02:00 it gets you back on track.
- 02:02 It's just a good way to sort of do things.
- 02:03 So with ours, we want to create, I'm just going to do a math flashcards and
- 02:11 we want to have a menu that asks people if they want to do,
- 02:16 do adding, subtracting, multiplication or division.
- 02:22 And you can see I'm just doing a very simple list,
- 02:25 I'm not going in any sort of details at all.
- 02:27 Just a very rough sketch of what you want to do.
- 02:30 And you can get more detailed if you want.
- 02:32 We can say we want to loop through the menu and blah, blah, blah.
- 02:38 But, this is a pretty simple app so we don't have to get that technical.
- 02:44 So then, we want to be able to show a math problem and
- 02:50 then get the user's input and then check the input answer,
- 02:57 reverses the correct answer.
- 03:01 And then we want to output whether
- 03:06 they got the answer right or wrong,
- 03:11 and then ask them if they want to play again,
- 03:18 and maybe show menu or end game.
- 03:22 So very simple, just a little list that kind of maps out what we want to do,
- 03:26 sort of puts our thoughts in order.
- 03:28 And then we can go through here, and say, okay, we need to create a menu.
- 03:32 Okay, we need to do this, we need to do that.
- 03:34 What do we need to do in order to do this, and then we can go from there.
- 03:37 It's just a nice starting spot.
- 03:38 So, that's what we're going to do in the next couple of videos.
- 03:41 We'll start to build this thing and it should be a lot of fun.
Lesson notes are only available for subscribers.