00:00 Do you like to play games or solve puzzles?
00:01 Chances are pretty good that you do.
00:03 After all, what is programming and software development but one really elaborate puzzle?
00:08 On this episode of Talk Python to Me, you'll meet someone who has pushed this idea of programming
00:12 as a game to its logical conclusion.
00:15 Alexander Leibach is the creator of Check.io and Empire of Code.
00:19 Check.io is a programming adventure game where you solve puzzles and share them with fellow
00:24 players.
00:24 Empire of Code is a tower defense game where part of the strategy is to actually program
00:29 the AI in Python.
00:31 This is Talk Python to Me, episode 75, recorded September 8th, 2016.
00:59 Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the
01:07 ecosystem, and the personalities.
01:09 This is your host, Michael Kennedy.
01:11 Follow me on Twitter where I'm @mkennedy.
01:13 Keep up with the show and listen to past episodes at talkpython.fm and follow the show on Twitter
01:18 via at Talk Python.
01:20 This episode is brought to you by Hired and SnapCI.
01:23 Thank them for supporting the show on Twitter via at Hired underscore HQ and at Snap underscore
01:30 CI.
01:30 Hey, everyone.
01:32 Thanks for listening as always.
01:33 Before we get to the interview with Alex, I want to give you a heads up on something I've
01:37 created just for you listeners.
01:38 Near the end of this episode, I speak with Alex about the class management and group management
01:43 features in the game in Check.io.
01:46 So I've decided to create a class that consists of all podcast listeners.
01:50 If you want to group up with your fellow listeners and do some of these puzzles, you can use the
01:54 following link to join up and share your updates and solutions.
01:58 Just go to py.checkio.org slash group slash talk dash python dash listeners, create an account or log in, and then say you want to join the class.
02:07 You can, of course, find that link in the show notes as well.
02:10 If you're a teacher yourself, keep an ear open to the end of the show about how you can do this for your own classes, whether that's university, high
02:17 school or middle school courses.
02:18 Now, let's talk to Alex.
02:20 Alex, welcome to the show.
02:22 Hi.
02:23 It's great to be here and a big honor for me.
02:26 Thank you.
02:26 Oh, it's my honor to have you.
02:28 I really appreciate you coming here.
02:30 We are going to talk about programming and games and some really interesting stuff that you guys have built over at checkio.org.
02:37 Yeah, I love to talk about it.
02:39 I bet that's your baby, right?
02:41 Okay.
02:42 So before we get to talking about that, let's hear your story.
02:47 How did you get into programming and Python?
02:48 Yeah, that was a long time ago, the high school.
02:51 So I remember before that I was using my father's computer only for games.
02:58 So I was a big gamer.
03:01 But at that time, my friends come in and show me his first code.
03:06 It was Pascal.
03:08 And I was so much amazed how easy it is.
03:12 How, what are cool things I can do by coding.
03:17 And I started taking coding class with him.
03:20 So, yes, it was the Pascal a long time ago.
03:23 And then later on in my university, it was Delphi, then PHP, Perl, and then Python.
03:31 And I stayed with Python for a long time already.
03:34 I love it.
03:35 Yeah, Python's really nice.
03:36 It definitely has some improvements on those other languages that you mentioned.
03:40 But also the community is so excellent, right?
03:43 It's really fun to work with the people who like Python, not just the technology.
03:48 Yeah.
03:49 I remember myself starting actually the Python.
03:52 So when I was, my first programming job actually was Perl developer in a bank.
04:00 So, and when the first time I saw Python's piece of code, I was amazed how beautiful it is.
04:08 Is it actually a really code?
04:09 Like, it can be a poem or like a song, but it's not a code.
04:14 Because like before I was coding Perl for four years.
04:19 And it was so beautiful.
04:22 I was so amazed at that time.
04:24 So I started doing some, start learning Python after work and eventually quit my job and start doing Python freelancing.
04:33 That's cool.
04:34 And was that like web development or what kind of apps were you building?
04:36 Web development, yeah.
04:38 Python, Django.
04:39 Okay, with Django.
04:40 Yeah.
04:41 Uh-huh.
04:41 Nice.
04:42 I remember Django when it was, remember new forms, like with this transaction.
04:48 Still my favorite framework.
04:50 You've moved on to building something that is actually a pretty incredible web app.
04:58 I must say a couple of incredible web apps, I guess.
05:02 And a whole interesting world here that brings all the stuff that you talked about, more or less,
05:08 together at Check.io.
05:11 Tell us what is Check.io.
05:12 Back to the time when I just started learning Python.
05:17 I think the first line of code was written during my first year of learning Python.
05:25 So at the time, as I said, I was so much amazed how beautiful Python is.
05:30 And I thought it should be a gallery.
05:33 It should be a gallery of different Python solutions since it's so beautiful.
05:38 And if I create a new solution, I should share it somehow.
05:42 I should show it.
05:43 And I should go through all other solutions and see how everybody else solved this particular puzzle.
05:51 So this is why I created Check.io.
05:56 And later on, I have more people join the team.
05:59 But yeah, the first version of Check.io wasn't that beautiful.
06:04 But the core idea is still from the very beginning to the version that we have right now,
06:11 is that you should solve the puzzle.
06:14 And you can share a solution if you want.
06:18 But after you solve the puzzle, you can see a solution of other users.
06:21 You can discuss their solution.
06:24 There are several categories for the solution, like clear code, creative code, speedy code.
06:30 And I love this feeling, you know, when you're spending like five hours in a row
06:39 trying to figure out how to solve this mission, this puzzle.
06:44 And later on, when you solve it, and maybe even you share your solution,
06:50 and then get into solution of other users, and you're like amazed.
06:54 Oh my God, it's possible to solve in two lines?
06:57 I can't believe.
06:58 And why I didn't figure out this later?
07:00 And I think this is the perfect learning curve.
07:03 Like when you're trying to figure out it by yourself, then see how some other users solved it.
07:10 And again and again, I think, so I know a lot of people who become a Python developers,
07:16 very good Python developers through the checker in that way.
07:19 Yeah, it's really cool.
07:21 So maybe I should just try to give like a visual description of the experience.
07:27 Yeah.
07:27 So you come in, you create an account, and then you land in this world of floating islands.
07:35 And it has this very 3D feel with animations and stuff, even though it's in a flat web page.
07:40 You know, it doesn't, it's not like a Flash game.
07:42 It's HTML5 or something like this, yeah?
07:44 Yeah.
07:44 Yeah, with Canvas and whatnot.
07:46 Cool.
07:46 And so you have these worlds, and each world represents a set of similar programming puzzles.
07:55 Did you ever play the game Myst, M-Y-S-T?
07:57 One of these super beautiful but puzzle-oriented games.
08:02 And it feels like a little bit like that for code.
08:04 Like you go to these different parts of the world, and you go in, and you get these different puzzles, right?
08:09 Yeah, yeah.
08:11 By solving those puzzles on each island, eventually you can get more island open around this island,
08:16 and you can explore more and more island around.
08:20 Yeah, it's quite neat.
08:21 I think, you know, you go into these puzzles, and I guess there's probably 5 to 20 puzzles per little island.
08:29 And you go in there, and they're ranked in levels of difficulty and categories.
08:33 So some are like data structures, and some are finding bugs or things like that, right?
08:40 And you also have a difficulty level.
08:42 Actually, all the time we're trying to experiment with different kind of puzzles.
08:47 So in some part of Checker world, you can find like a machine, like you said.
08:53 You just need to fix the bug on the solution, so we actually give you a solution.
08:59 It's almost working.
09:00 There are some, but some, there are some tests that doesn't work.
09:06 So your mission here to fix those bugs.
09:09 There are some other missions that you actually don't share your solution,
09:14 but you can get more points for these solutions, depends on the rules.
09:20 So for instance, we can ask you, try to solve this puzzle in a short way possible.
09:27 So your solution should be as short as possible.
09:29 I call that coding golf puzzles.
09:32 And after you solve, you can see how short solution of other users.
09:38 And you think, oh my God, I think it's, I'm like spending all night and get 50 symbols,
09:44 and someone find out how to make it in 12.
09:49 I can't believe in.
09:50 Yeah, it's really amazing.
09:52 And like you said, you can, you basically, you write the solution and it's,
09:58 it's run by the system.
09:59 And we could talk about how you write your solution and all that in a moment.
10:03 but you write some Python code that solves the problem under the conditions,
10:07 the inputs and outputs that you're supposed to, which usually they're pretty self-contained.
10:11 It's not too elaborate.
10:12 So, but they are kind of tricky in some interesting way.
10:16 And then once you're done, you can categorize your solution.
10:20 If you want to share it, if you want to publish it, as like you said, like really concise,
10:25 really efficient, you can just leave it and say, I don't have no idea what you would call this,
10:30 but it works, things like that.
10:32 And it reminds me, you know, you can go through the solutions and you can see other people's solutions.
10:36 And my feeling is, it's a little bit like the Mark Twain quote that says,
10:41 I'm sorry I wrote you a long letter.
10:43 I didn't have time to write you a short one.
10:45 You know, that, that kind of thing.
10:46 Like, like I go through and I solve it.
10:49 I'm like, oh yeah, this is, this will totally do it.
10:51 And then you just flip the next line and it's like, filter this, did it at one line.
10:56 You're like, whoa.
10:56 Okay.
10:58 It also, I think it's really interesting in that it, it sort of touches on this concept
11:03 of Pythonic code by looking at the solutions, right?
11:07 Yeah.
11:07 So in the new Python release, we are trying to test this new idea.
11:11 So we actually put, so mission has three stages.
11:16 So in the first stage, it's the collecting modes.
11:19 If you see some of others, you should share your solution first.
11:23 No matter what.
11:24 So let's, we're looking for collecting mode.
11:28 Then, so viewing mode.
11:30 So you might not share your solution, but you should definitely solve this,
11:35 no matter what.
11:36 And then you can go and see leaderboard of other user solution, review their solution,
11:42 and so on and so on.
11:43 So usually what we see right now.
11:45 that we may be some other checker users, we are trying to figure out, out of all the solutions,
11:52 we pick some solutions that we think are the most different.
11:57 It might be not that, it might be not as perfect as it should be, but they are definitely unique
12:05 in the whole specter of solutions.
12:08 Okay, that's interesting.
12:09 So you try to provide like a variety of answers to people?
12:12 Yes, yes, yes.
12:13 So you, all the time you see, when you check editor's solutions, you see only different
12:19 and only unique solutions that we find in checker.
12:22 So this is the third stage of each mission.
12:26 It is really interesting.
12:27 So I learned a lot when I solved some of the problems and published it.
12:31 And I realized that there were biases in the solutions I was creating.
12:36 And I didn't, I didn't realize they were biases.
12:40 Like for example, on one of them that I was working on, I was trying to do stuff
12:45 what I felt like was the most efficient way, not in lines of code, but what I thought
12:50 would be like the most efficient algorithm for like maybe large data sets
12:54 or whatever.
12:54 And that resulted in, I don't know, maybe eight lines of code.
12:58 And then other people were doing the answers with like a list comprehension
13:01 in one line.
13:02 But I'm like, oh, but that's going to be way slower.
13:04 But, you know, I guess it depends on what you're aiming for, right?
13:08 Like if you're aiming for super readable and you know you're not working
13:11 with, you know, 100,000 lines of data elements, you're working with 500,
13:16 then, you know, probably that solution is way better.
13:18 And so it just, I thought it was interesting that it brought out little biases
13:24 that I had in ways of approaching problems that I didn't, it's not like I started out
13:28 to say, oh, this will be way more efficient if I do it this way.
13:30 So let me try this.
13:31 It's just, that's the way I started writing the code.
13:33 So that was really interesting.
13:35 Yeah, this is why we created Couchverse for this session.
13:38 Depends on your, what is your aim to, what was your goal while you created this solution.
13:44 Some of the people just love to create crazy solutions, like one-liners or just
13:51 try to make it as confusing as possible, I would say.
13:55 So we have one, one of the most famous user on check, Vicky.
14:00 And I want just to say hi to him if he, I'm sure he's listening to this podcast.
14:06 So he has the most biggest amount of followers in the game and he is, he'll love to create
14:14 the most crazy solutions.
14:15 So I think the creative category we created just specifically for Vicky.
14:20 And yeah, for those unique people who love to create some unique solution
14:26 or create a creative and they're competing with each other in creativity.
14:31 Yeah.
14:32 Yeah.
14:32 Yeah, that's, yeah, I think it really does bring out a lot of, a lot of interesting stuff.
14:37 Would you say, it seems to me like, tell me if I have the right sort of feeling.
14:43 I did start at the beginning so I kind of feel like I can at least guess at this.
14:47 That Check.io is really good for people that know something about programming
14:53 but in order to do it, you kind of need to know a little bit, a little, almost a little tiny bit
15:00 of Python rules, right?
15:02 Like how to define code blocks or suites and how to perform conditionals.
15:08 And so it's, it's not like I'm bored with my job in finance and I've never touched
15:14 a line of code but I want to come learn it.
15:16 You've got to be a little bit into programming.
15:19 Yes.
15:19 I do have this question a lot, why we are not teaching Python and I do have
15:25 a lot of questions like this.
15:26 Well, you are teaching Python, you're just not teaching zero to like the very first step.
15:32 this is what I love.
15:33 Yeah, yeah.
15:34 So we are not teaching like you said, we are not teaching from zero to some point.
15:39 So I do believe that in internet out there, there are so many places where you can learn
15:46 how to code but there are so few places where you can actually learn how to create,
15:52 how to produce code with a good quality and yeah, and I believe that Checo
15:59 is one of those places.
16:00 So this is our goal to not maybe to teach you how to code but teach you how to create
16:07 a good coding solutions.
16:08 Yeah, I think that that's correct.
16:12 You're right, there are so many places to learn to code these days if you're kind
16:16 of like a career switcher.
16:18 I kind of think of people as they're like, I know that I want to get into programming,
16:22 I have no idea what that means, like that level that you probably got to start
16:26 somewhere else but I heard someone say, one of my listeners suggested that I
16:31 reach out to you again and we get this show put together and I, sorry, I don't remember
16:35 who it was but thanks for contacting me on Twitter and they said, look, you guys really
16:40 have it right, you have it so that you want to just keep learning and you want to
16:45 make learning to code addictive and fun and I think that's a way more important service
16:50 than teaching people what a variable is or what a string is or, you know,
16:56 what an if, the concept of an if statement for example.
16:59 Yeah, this is actually one of the reasons why a lot of teachers and in a lot of university,
17:06 teachers recommend us as an additional way to learn coding so because we don't
17:12 provide any learning materials or something like that, we probably, we don't have any conflicts
17:20 with what they are teaching, we just give them an additional way to learn.
17:24 So if you are, right now, if you are learning how to code and even from zero,
17:31 you should definitely start practicing right from the very first day and you should learn,
17:37 you should find some places to do it and Check.io, I think it's the perfect place
17:41 to do it.
17:42 Yeah, it's definitely a good place to start because often people start wanting to code
17:46 because they've got some grand idea but the grand idea is, it can be so overwhelming
17:51 because you don't even know where to start but Check.io, the missions are
17:55 sufficiently self-contained that it doesn't feel like, oh, there's no way
17:59 I can get, like where do I even start, right?
18:01 You can get started and it's pretty structured so I think it is a great place to learn.
18:06 Let's talk about the experience of doing the exercises.
18:09 Okay.
18:10 I go to my little island which like I said is beautiful, it's got little clouds
18:14 and stuff and I pick my challenge, my puzzle and then it takes me to an online editor,
18:21 right?
18:21 We have online editor and actually at the same time with online editor we also have
18:27 web plugins and with those web plugins that you can install in your Chrome browser
18:34 Firefox, you can use your local editor actually.
18:39 So you don't need to actually, if you start doing some big solution or working on
18:44 a big problem on Check.io, you most of the time use your local editor.
18:49 So we give you this opportunity to use your local editor and then you just
18:54 open the Check.io and you see your code right from your local editor in our web editor.
18:59 Oh, okay.
19:00 That's awesome.
19:01 So like if I'm using PyCharm or Sublime Text or something like that, I can just sort of
19:06 download it and somehow the web plugin keeps my local version and my Check.io version
19:12 in sync?
19:13 Yes, yes, yes.
19:14 We're synchronized of both of those solutions.
19:17 So right after you make some changes in our web version of Check.io, this goes to your local editor
19:25 there as well.
19:25 So it's very easy for you to solve and actually, since you mentioned PyCharm,
19:32 we also partnering with PyCharm and also and the whole partnership starts with
19:39 PyCharm Education.
19:40 So we have this PyCharm has a plugin for PyCharm Education and using those plugins
19:48 you actually can solve puzzle actually by using PyCharm.
19:53 so the whole Check.io interface, those mission description, the island structure,
19:59 animation, and it all goes to write in your PyCharm editor and you can solve
20:07 coding puzzles right from there.
20:08 Oh, that's pretty interesting.
20:10 So I didn't realize that you guys integrated with PyCharm Education Edition.
20:14 So people have heard me go on and on about how I like PyCharm as like a proper editor,
20:19 but they have an alternate version for education that has these like lessons
20:24 built into it and so you guys have integrated with those lessons in some way?
20:27 Yeah.
20:28 They have this ability to create plugins for the PyCharm Education and right when I
20:34 figured out that PyCharm, my favorite editor, created the educational version
20:39 and I was, it is so crazy.
20:42 I should find a way to be part of this and yeah, I contact with them, we start doing
20:48 those plugins and eventually, yes, the plugin was released and we're both happy.
20:55 That's nice.
20:56 I'm going to have to check that out now.
20:57 So yeah, and one more unique idea for Checker Editor that we are using and the user love it
21:06 is that for some of the mission, we create this try it panel.
21:11 So let me tell you the idea.
21:14 so we wanted to present the solution you are trying to solve with some interface.
21:20 So we create for almost each coding puzzle, we create some interface.
21:26 For instance, if you need to find all the unique symbols in a piece of text,
21:33 right, we give you this text input and you can put your text in this input
21:39 and then click tests and it gives you the result, what symbols were unique
21:46 in this particular text and in order to get the result, those interface actually using
21:52 your code, the code that you have written in the editor.
21:56 And for instance, one other mission that's one of my favorite is Open Labyrinth
22:03 and there you have actually the whole labyrinth created and the idea for puzzle
22:10 is to find a way to get out of the labyrinth.
22:15 And in this interface, you can create your own labyrinths.
22:19 After clicking solve, you see how some arrow, small, tiny arrow, trying to get,
22:27 find a way out of the labyrinth by using actually the program that you created.
22:32 So, in such a way, we're trying to show you that every piece of code has
22:39 an interface that's probably going to use your code.
22:43 It's not just this boring function or boring piece of code.
22:48 Take these numbers or turn those numbers, but something more advanced, huh?
22:51 Yes, yes.
22:53 This portion of Talk Python is brought to you by Hired.
23:07 Hired is the platform for top Python developer jobs.
23:10 Create your profile and instantly get access to 3,500 companies who will work
23:14 to compete with you.
23:15 Take it from one of Hired's users who recently got a job and said, I had my
23:18 first offer on Thursday after going live on Monday and I ended up getting
23:22 eight offers in total.
23:23 I've worked with recruiters in the past, but they've always been pretty hit and
23:26 miss.
23:27 I tried LinkedIn, but I found Hired to be the best.
23:29 I really like knowing the salary up front.
23:32 Privacy was also a huge seller for me.
23:34 Sounds awesome, doesn't it?
23:36 Well, wait until you hear about the signing bonus.
23:38 Everyone who accepts a job from Hired gets $1,000 signing bonus.
23:41 And as Talk Python listeners, it gets way sweeter.
23:44 Use the link Hired.com slash Talk Python to me and Hired will double the signing bonus
23:48 to $2,000.
23:50 Opportunity's knocking.
23:51 Visit Hired.com slash Talk Python to me and answer the door.
23:54 So the editor is really cool, and the fact that you integrate with the local
24:05 editors, I think, is even better.
24:07 And I noticed that at the top it says you can import some modules or create
24:12 additional functions or things like that, or classes or whatever.
24:16 Yeah, we have a set of modules that we allow you to import.
24:20 Yeah, that's what I was going to ask.
24:22 Like, surely pretty much the standard library for the most part, but then
24:26 are there external open source ones as well?
24:29 A lot of users ask to add SciPy.
24:32 Sure, some of the machine learning stuff maybe, yeah.
24:34 And NumPy.
24:35 So we integrated all of those modules for them, and even for Python version.
24:41 For Python, we created the specific category for those solution.
24:46 We call it third party solution.
24:48 And if you are using those kind of modules, we encourage you to share your solution
24:55 in those categories.
24:56 So for those categories, you can check solutions that are using those modules.
25:02 Oh, that's really cool.
25:03 Now, another thing that I see up at the top that makes me smile is in this
25:09 editor, and if you've ever used something like JS Fiddle, it's a little bit
25:14 like that with multiple panes and so on, if you haven't checked it out, is it
25:17 has sort of navigation, and one of the dropdowns at the top is it says I
25:21 can pick my Python version, and I could pick Python 2.7, but the one that I have
25:26 active is actually Python 3.6 alpha 3, or A3.
25:32 That's pretty awesome that you guys are running such a new version of Python 3.
25:38 Yeah, we are trying to keep Python version as fresh as possible, so users of
25:45 Check.io can play with the freshest Python version as early as possible, and
25:52 show some awesome solutions with new cool Python features that are coming out
25:59 soon.
25:59 So yeah.
26:00 Yeah, that's really cool.
26:02 So if you want to say, look, I'm going to demonstrate how much easier this
26:05 problem is to solve in Python 3.6 than it was in 3.4 or something.
26:09 You can do that, right?
26:10 Yeah.
26:11 Yeah.
26:11 Yeah.
26:12 How awesome.
26:13 Okay.
26:13 That's really cool.
26:14 Thank you.
26:15 Yeah, you bet.
26:16 So once I get my solution and I write it, and I can play around with it,
26:21 my console or my local editor, I mean the online terminal console, or my
26:26 local editor, and then once it passes, it gives me a couple of options, right?
26:31 I can basically just save it, or I can publish it and share it with the world, right?
26:36 As I said, this is what the first, very first idea of checkout, the core idea of
26:41 sharing code solution with other users.
26:44 So this is where you can share your code, pick a category, in which category
26:49 actually you want to share your code.
26:51 It can be a clear solution if you think this is the code the most appropriate
26:56 for actually production code.
26:59 This can be creative solution like one liner, some crazy ideas, some funny solutions.
27:07 It can be speedy when you're focusing, so no matter how clear it is, I only
27:13 want to create the solution as fast as possible, and as I mentioned, just
27:19 earlier, third-party solution when you're just using some additional modules,
27:25 and we also have uncategorized.
27:28 When you're not sure which category you want to share, you just want to share
27:33 this solution.
27:33 Maybe later on you want to share with your friends as well, so we create this category
27:38 for you as well.
27:39 So, yes.
27:40 And after you share, or maybe after you solve, you can get into solution of other
27:47 users.
27:48 This is actually where all the magic happens.
27:50 You actually can see solution of others, upvote, downvote solutions, you can make code
27:58 reviews, and sometimes we have so crazy code reviews, very details, like every line,
28:05 why it's good, why it's bad, and, yeah, very educational part of Checker
28:09 is actually inside of these solutions sharing.
28:13 And you can actually follow some of the people, some of the people on Checker, and
28:19 you can filter all the solution by only people you follow.
28:23 So it's easy for you to find your favorite solution.
28:27 Yeah, that's cool.
28:28 Like, you've got, like, an activity, sort of stream of activity on there, and it'll
28:34 show you, like, this is the activity around the various puzzles you've solved, or you
28:38 can follow people and things like that, right?
28:40 One of the earliest features as well, somehow it become naturally, like,
28:45 if I very love what some of the user is doing, I want to follow him, I want to know
28:53 first what other solution this guy have made, and what code reviews he's
28:59 doing, which solution he'll like and don't like.
29:01 And that's why we created this activity, so you can follow your friends, maybe your
29:07 classmates, maybe your teacher, actually, or maybe just a random guy who's just
29:13 using, like, Becky.
29:15 Yeah, that's cool.
29:16 So if I'm, like, so the other thing I can do once I publish it is I can start cycling
29:20 through similar solutions that are either similar or different than mine,
29:24 and maybe I find one that's like, oh, that is so much more clever than what I
29:28 had done.
29:29 Maybe you could follow that person and just see what they're up to, right?
29:31 Yeah.
29:32 We actually, in activity line, we actually can propose you some of the users to follow.
29:38 Depends on maybe you have some intersection with this user during the game, like,
29:44 you like his solution a lot, or you, this person actually give you some code reviews
29:51 or whatever, some, any kind of intersection.
29:55 So when you next time get into your activity feed, we can propose you.
30:00 Maybe you want to follow this guy since you have so many common interests.
30:04 So, yeah.
30:05 Yeah.
30:06 Yeah.
30:06 Yeah.
30:06 Very cool.
30:07 You also have levels, like, reminds me of playing the MUDs way back when,
30:12 level 1 to 20, and there's just a few people that are 20.
30:16 That's cool.
30:16 Switch gears from the CheckIO puzzle story for just a moment.
30:22 The other thing that you can do, in addition to solving these puzzles in
30:26 this mist-like, sort of, visit the island style, is there's more of a tower defense,
30:32 World of Warcraft type of game that you've also created that has to do with
30:35 code.
30:35 Why don't you tell people about that?
30:36 So about a year ago, maybe more, we created one more game, Empire of Code.
30:42 So the idea of this game was what can happen on intersections, some popular game, like
30:48 Tower Defense, like Clash of Clans.
30:51 So we used Clash of Clans or Boom Beach as the game based game part of this.
30:57 And add coding there.
31:00 And what kind of game we can create?
31:03 What can it be?
31:04 So we start working and this is what happens.
31:07 Empire of Code is intersection, or you can say it's mixing of game strategy, like
31:16 coding, like Boom Beach, and coding.
31:19 So when you get started out, you have, you know, like a base and you can
31:24 build attack type units, like people and whatnot, and defensive ones, like
31:30 little turrets and whatnot, like a standard tower defense game.
31:35 But then how does coding fit into this?
31:37 This is a good question.
31:39 One of the ideas behind Empire of Code is that you actually can play this game
31:44 even without coding.
31:45 So you should somehow know how to code in order to progress in the game.
31:52 In Empire of Code, you don't need it.
31:54 You just play the game as long as you want.
31:57 But eventually, some puzzles can pop up and tell you, okay, you can improve this
32:04 building if you solve this puzzle.
32:06 You may not, but if you solve this puzzle, this building that produces resources
32:13 for your troops can produce in a more efficient way.
32:18 So you might, okay, good to know.
32:21 I'll get back to it later.
32:23 Or maybe you can start right away.
32:25 So this is one part where coding actually can be used.
32:32 And another part of the game is that actually in order to control your troops in the
32:38 game, you should do coding.
32:40 So on the coding, you can control your troops in the battle.
32:45 So I'll say it again.
32:46 You can control your troops in the battle by code.
32:50 So you can say, okay, this can go at that point and then attack this tower by reading
32:56 a code.
32:57 but in the same time, we give you some basic strategy that you can use without
33:03 going.
33:03 So use whatever strategy you want.
33:06 And the awesomest part of this, the whole game, is that the whole game is the
33:10 competition between two forces, Python and JavaScript.
33:13 So right after you finish the tutorial, you should choose which side you want
33:21 to join.
33:22 if you join a Python site, you can conquer Python bases.
33:26 You can only conquer JavaScript bases.
33:29 And if you choose JavaScript side, you can only conquer Python bases and
33:35 still resources from that bases.
33:37 So it's pretty fun as well.
33:39 That's really awesome.
33:39 So these puzzles you solve around like your buildings and structures and
33:43 whatnot, is that a little bit like letting you mob the game?
33:47 Like you can change the behavior of the thing?
33:49 Or is it more just like you solve the puzzles and it gets more power?
33:52 Do you know what I mean?
33:53 Like could I write an algorithm that would change the way like say a tower works as
33:58 part of like improving it?
33:59 Or do I just like solve a puzzle and then the tower goes up a level or something?
34:03 Thank you for this question.
34:04 Actually for towers that defend your base, there are actually two kinds of puzzles.
34:11 The first kind of puzzles is they just after you solve this puzzle, the tower becomes
34:17 stronger or it has more health and it's hard to destroy the tower.
34:22 And another coding part of this tower is you actually can write a strategy as
34:30 well as like you are creating strategy for your troops in the battle, you can
34:35 create strategy for your defend tower.
34:38 So for instance, it can be, okay, if I see a heavy bot running on me and some small
34:48 bots that also running on me right now, I would like to destroy those small bots first
34:55 and then I start doing, like I start destroying, start attacking those heavy
35:04 bots because it's more efficient in that way.
35:06 So you can play this strategy on a defense base, on a defense building.
35:11 Does it make sense?
35:12 Yeah, yeah, that's really cool.
35:14 nice.
35:14 Yeah, and you can basically when you get into an area, you can say attack with this
35:20 strategy and then you can actually have like a little editor for each strategy, right?
35:24 Yeah, yeah.
35:25 And one of the awesome parts that I love a lot, so do you remember I said
35:29 that there's actually competition between two forces, Python and JavaScript.
35:34 But actually you can ask your, if you are playing for Python, you can ask your Python
35:40 fellows that also play in this game, can you test my defense strategy?
35:45 And they actually play against your strategy, but the difference is nobody,
35:49 they are not going to lose their troops and you're not going to lose any resources in
35:54 any cases.
35:55 So you can use your teammates for testing your strategies, for testing your defense
36:02 and attack strategy.
36:03 Yeah, that's really cool.
36:04 Thanks.
36:05 Yeah, it seems like a fun game.
36:06 I wasn't able to play it super far into the game, but it's definitely a cool idea.
36:11 I like it.
36:11 And that's also a web-based game, right?
36:13 Yeah, it's completely web-based, HTML5.
36:17 We all want to ship our software faster, respond to user requests, and build an edge on
36:36 the competition.
36:36 But the faster you go, the more likely a bug or issue will slip by and cause
36:41 your users grief.
36:42 I have the same trade-offs with my Talk Python websites and infrastructure.
36:45 That's why I use SnapCI.
36:46 Every time I check in at GitHub, SnapCI springs into action.
36:50 A clean copy of code is pulled from GitHub, a Python 3 virtual environment is created,
36:54 all the packages and dependencies are installed, the unit tests are run,
36:58 finally I'm notified in Slack and a menu bar on my Mac about the outcome.
37:02 That way I know it's safe to ship a shiny new version of my web app.
37:05 Ship your software faster with a 30-day free trial at snap.ci slash Talk Python.
37:19 It's kind of played on like a tablet or a phone, on the browser on them.
37:23 It's not very adapted for iPhone right now, but we are working on it.
37:27 The most efficient way to play in this game is from your desktop.
37:33 Yeah.
37:33 Yeah, sure.
37:34 Any browser.
37:35 Something with a keyboard and a mouse.
37:37 Cool.
37:37 So, I haven't brought it up yet because it's not super relevant to the audience necessarily,
37:43 but one of the things you guys did just add, and you touched on it here, is you've
37:47 recently added JavaScript support.
37:49 Like, it used to be just Python for, say, like the Czech I.O.
37:52 puzzles, but now you have JavaScript versions as well, right?
37:54 Yeah.
37:55 So, in Czech I.O.
37:56 we decide not to create a lot of languages at one time.
38:00 So, a lot of coding puzzles, coding games, or something like that, they are adding
38:07 many languages in one time.
38:09 So, 20 different languages.
38:11 you can use any of your favorite languages in order to solve the puzzle.
38:14 First of all, we were in Python.
38:17 We tested a lot of different ideas.
38:21 What does work, what doesn't work.
38:24 And then, later, when we figured out, okay, we have pretty solid ideas, and we can replicate
38:29 it.
38:29 The next language to try for us become a JavaScript.
38:36 So, we decided to start growing JavaScript communities.
38:40 Since JavaScript become more and more popular, there are a lot of new frameworks,
38:46 new ideas coming out of the JavaScript, and there are new fancy ways to coding JavaScript,
38:53 like React, and so on and so on.
38:55 So, we decided to create something for JavaScript community as well, since we are all
39:01 coding JavaScript somehow, and want to learn how to do it in a more efficient way.
39:06 So, we just recently released JavaScript Checker for JavaScript players.
39:12 So, the Checker become a portal between Python coders, between Python Checker
39:20 and JavaScript Checker.
39:21 But, every portal is still independent.
39:24 So, in Python, we are talking only about Python.
39:27 All the solutions only about Python.
39:30 And in JavaScript, it's also independent.
39:33 So, yes.
39:34 Yeah, okay.
39:34 Yeah, very, very cool.
39:35 So, if you're into JavaScript, also, I'll do something here for you.
39:39 Nice.
39:40 Now, one of the things I like when I go to a mission is, if I go there, it has like a
39:46 summary description, then a button to solve it, and that's cool.
39:49 But it also has a GitHub link at the bottom to the actual problem, the verification,
39:56 and everything.
39:57 And they're stored in various places, but one of the places that has a whole
40:02 bunch of them is github.com/checkio-missions.
40:06 And you guys have many, many pages of the solutions and the starter code,
40:12 because often you start with starter code and little tests and whatnot.
40:15 I think that's a really cool touch that each one of these missions or puzzles,
40:19 rather, you can go and see the code for.
40:22 Yeah.
40:22 So, what we decide is we decide to open source those puzzles, and there are
40:29 some reasons for that.
40:30 first of all, while we're creating some puzzles, we often make some mistakes,
40:37 like we forgot to add some tests, and after you go through the solution,
40:44 you think, okay, this is the wrong solution, it shouldn't work.
40:49 And you go to a mission repository and see, okay, they don't have this test,
40:55 and they should have.
40:57 And you create a pull request to us that explains you guys should add this test,
41:02 and we add this new test for this mission and test all the solutions once again.
41:08 So, one of the reasons is so the community can improve our mission.
41:13 Yeah, I think if you're looking at a problem and you're like, oh, but it's not testing this,
41:17 and this person who says they have a solution, it's not really the right solution,
41:20 that can be frustrating.
41:22 so you could just go do a GitHub pull request and go, I'm at another test,
41:25 right?
41:25 Something like this.
41:26 Yeah, that's cool.
41:27 Also, what we allow our community is to provide a translation permission.
41:32 So, actually, you can, each mission has up to seven different languages.
41:38 So, you can choose which language you want to read this particular mission.
41:43 And we have a lot of Chinese translation, Russian, of course, Ukrainian,
41:47 Spanish, and German.
41:49 So, a lot of people can just commit a new translation just from GitHub.
41:54 They just go and create a new pull request with new translation and we just
42:00 merge this pull request and check have one more new translation.
42:05 This particular mission have one more new translation.
42:08 And, for instance, if I'm native Russian and Ukrainian speaker, I can see
42:14 translation, Russian translation, okay, this is not correct and go and make
42:19 a pull request in this translation and make this translation even better.
42:22 So, yeah.
42:24 Yeah, that is really cool.
42:25 Yeah.
42:25 And also, an additional way, additional thing that you can actually improve
42:31 in CheckIO is that we actually have a set of hints for some mission.
42:35 So, if you're stuck in a solving mission, we have a set of hints and that
42:42 allows you with small pushes that can get you in the right way by doing this
42:49 small push like, okay, maybe you should try to Google this thing.
42:54 Maybe, what do you think if we, here is the link on a Python tutorial, maybe you
42:59 can find something here.
43:01 So, those small pushes, we call hints.
43:04 And, you can do a pull request and give us some hints for this mission.
43:13 that's really cool.
43:14 Can I create my own mission?
43:16 Like, if I want to add a mission to the scientific expedition island, how do I
43:21 do that?
43:22 We have a set of tools for mission creatives.
43:25 And, actually, there are a lot of missions that was created by other users who
43:31 has an idea.
43:32 Sometimes, users can just send me an email.
43:34 I have an awesome idea, but I don't have time to create it.
43:38 Can you create it?
43:39 Yes, of course, we can create this mission for you.
43:41 But, sometimes, users just create those missions by themselves.
43:45 And, if you find in the mission, the right panel of the mission, there are
43:51 a page with after name on this page.
43:55 So, each mission has their own after who created that, who actually created this
44:00 mission.
44:00 Yeah, that's cool.
44:01 I saw that.
44:02 Is there criteria for taking a mission or not?
44:05 Like, if somebody makes a mission and it's basically the same as another,
44:08 would you say, thanks, but no?
44:10 Or, what do you look for when somebody comes with an idea?
44:14 We have some procedure in order to accept this mission to Checker Map.
44:21 So, every person who created this mission, he should submit this mission first
44:27 on the forum, in some specific section of the forum, and where experienced
44:36 players who played a lot in Checker, they, first of all, those group of people,
44:41 they are mainly for testing those candidate missions or whatever, candidate
44:47 puzzles.
44:47 Yes.
44:48 And almost all the time they can propose some changes.
44:52 The mission definition, puzzle definition is wrong, or maybe some tests are missed,
44:58 or whatever.
45:00 There are some various, so they are starting to discuss.
45:04 those mission after, he is taking part in the mission discussion, and after
45:10 this, we have pretty solid mission.
45:13 After that, our team member can improve this mission as well.
45:18 For instance, we can add some animation part in this part, or try it panel,
45:23 or maybe our designers want to create illustration for this mission.
45:27 So, we also take part in the mission creation.
45:31 And after that, we put this mission on the island.
45:34 And if you subscribe on Checker newsletter, you will get in use that we have
45:44 some new missions coming out, and you can be the first one who tried and played
45:49 this mission.
45:50 That's awesome.
45:51 Yeah, very cool.
45:52 I love it.
45:52 That sounds really great.
45:53 And I like that you add illustrations and stuff and kind of make it feel
45:58 more part of the thing once they add it.
46:00 Thanks.
46:00 We have very cool and very passionate designers team.
46:04 Yeah, the designers definitely are doing nice work there.
46:07 Like I said, the overall view of the islands is just totally beautiful.
46:12 It's great.
46:13 So, I want to touch on two things really quickly before we, maybe three,
46:18 before we call it a show.
46:20 So, one of the ones I wanted to ask you about is you said there's something like
46:25 a Czech IO classroom or something like that.
46:28 What's the story there?
46:29 Yeah, as I mentioned before, there are a lot of universities and some classes
46:35 and teachers who are using Czech IO as an additional material.
46:39 So, you know, guys, just take this site and you use whatever you want to use
46:45 and just improve your skills there.
46:48 so, we want to help those teachers in their class.
46:54 We give them an additional functionality.
46:57 We give them more hands-on on Czech IO.
47:00 So, if you are a teacher who is actually teaching class, you can put all
47:06 your students in Czech IO and they will be in some group.
47:08 And while they explore in the world, while they're solving puzzles, they can
47:14 interact with each other.
47:15 So, those activity pages that you saw, the whole activity become the class
47:20 activity and you see activity of each class member.
47:24 If you solve some puzzle, first you see solution of your classmates and then
47:30 you can go and check solution of other Czech users.
47:33 And what else we have?
47:36 We have this progress page.
47:39 So, in this progress page you can actually in one page you can see all the
47:45 missions that your class solved and all the students and you can see all
47:49 the intersections who solved each mission and you can go and see solutions
47:53 that were shared by this particular person.
47:56 So, what actually Classroom is doing is just give some, we don't want to
48:01 change checker for classrooms but we want to give more power to teachers
48:08 so they can keep their class together.
48:11 Yeah, that's really nice and if you go into one of the pages like your profile page
48:15 that has a footer there's a class manager at the bottom and it looks really
48:19 easy.
48:20 So, let me give you a few scenarios and you tell me if this makes sense is
48:24 one one thing I could do is I could create a class and the class could be
48:29 talk Python listeners and everyone who listens to the podcast could they
48:33 be in a class and go through it together and share ideas as a group?
48:37 Yes, yes.
48:39 So, if you are creating a class you have two options.
48:41 First option you can simply put all the emails that you think you want to
48:46 add in this class in the specific text field and then put some messages out
48:51 there and just send it out.
48:53 This is the first option.
48:54 And the second option you can just provide you with the link and this link
49:01 has a page of your class and some button below that actually tells I want
49:10 to join to this class.
49:11 The only thing that you should done after join you as a class creator should
49:16 go and approve this joining right?
49:19 I see.
49:19 And after that you can have the whole class just for your podcast listeners.
49:25 Okay.
49:26 Cool.
49:26 Yeah.
49:27 Also like for some of my online courses maybe I'll see if I can create a class.
49:31 I'll look into it.
49:32 That's very cool.
49:32 Thanks.
49:33 Yeah.
49:33 I will create additional video tutorial that I will explain all the features
49:38 and I will share it and check out so you can go there and see how exactly
49:43 it works and how you can use it.
49:45 Okay.
49:45 Excellent.
49:45 Yeah.
49:46 And I'll try to link to that if the timing lines up.
49:48 Cool.
49:49 So that's one thing I wanted to cover.
49:51 The other is can you give us a look behind the scenes at the technology involved?
49:55 Like are you using Django?
49:57 Are you using Docker?
49:58 Like how's Python in the backend working?
50:00 Like those kinds of things.
50:02 Yeah.
50:02 I would love to.
50:03 So we are using Django for web part.
50:08 Also for running coding solutions, running user solutions.
50:12 We're using Twisted and we're using Docker.
50:15 So every mission is covered in Docker container and running in the Docker
50:25 container.
50:25 And all these runs and all those runnings are actually managed by Twisted
50:33 server.
50:34 And that's cool.
50:35 Is that also for Empire of Code?
50:38 Yeah.
50:39 The same kind of things actually working for Empire of Code but we make it a little
50:45 bit different for Empire of Code.
50:47 We actually every mission is actually Docker container and for every mission we
50:53 have somehow prepared the Docker container before the run.
50:57 And it's actually a little bit more efficient.
51:01 I'm not sure.
51:02 I think this part may be too much detail.
51:04 Yeah.
51:05 We don't have to go into too much of the details but I saw it will take a few
51:09 moments for us to deploy your army to this asteroid.
51:13 I'm thinking oh is that a Docker container because it's running your code strategy
51:17 and stuff like that.
51:18 yeah we had a lot of complaints from why don't you show me progressively
51:25 how my army is going.
51:26 Yeah we are actually running all the code and then show you the result.
51:31 Yeah cool.
51:33 Awesome.
51:34 All right well we're getting pretty much out of time so I think maybe we'll leave
51:38 it there.
51:38 But Alex this has been a super interesting look where Check.io came from and where
51:44 it's going.
51:44 So thanks for that.
51:46 Thank you.
51:46 Thank you for inviting me here.
51:47 It was great.
51:48 It was a big pleasure for me to share all the ideas.
51:52 You're welcome.
51:52 Now before I let you go I have two questions I always ask my guests.
51:55 The first one is I just checked there are if I look at pypi.io which is the
52:01 shiny new Python package index.
52:04 It's still it says it's in beta but the backing data store is the production data
52:08 store so you might as well use the pretty one.
52:10 If you look there there's 88,000 plus packages today which is amazing.
52:16 It's so amazing right?
52:17 And of those there's tons that you're exposed to that people maybe don't know about.
52:22 Is there a favorite one you're like hey everyone should know about this but they
52:25 probably haven't heard of it.
52:25 I think everybody heard about Django so I think this is my favorite package
52:30 that I'm using a lot so yeah Django is one of my favorite and I don't have any
52:36 fancy one that I think everybody should use.
52:39 Yeah all right so Django check it out very cool.
52:41 And if you're going to write Python code and it's not in your online editor
52:45 what what editor do you open up?
52:47 I'm using PyCharm.
52:48 This is definitely one of my favorite code editor.
52:51 Yeah I love PyCharm too.
52:53 I use it for almost all my Python work and it's one of those things that you
52:58 kind of have to take a moment and learn but as you learn more features they add up you're
53:02 just like okay I have to use this thing.
53:03 It's very cool and I think it's awesome that they're partnering with you so well
53:08 done JetBrains guys.
53:08 That's great.
53:09 Yeah thanks.
53:10 All right Alex it's been a fun conversation.
53:13 thanks for being on the show.
53:13 Thanks for having me here.
53:15 You bet.
53:15 Bye-bye.
53:16 Bye.
53:16 This has been another episode of Talk Python to Me.
53:20 Today's guest has been Alexander Leibach and this episode has been sponsored by Hired
53:25 and SnapCI.
53:26 Thank you both for supporting the show.
53:28 Hired wants to help you find your next big thing.
53:31 Visit Hired.com slash Talk Python to me to get five or more offers with salary and equity
53:36 presented right up front and a special listener signing bonus of $2,000.
53:39 SnapCI is modern, continuous integration and delivery.
53:44 Build, test, and deploy your code directly from GitHub all in your browser with
53:48 debugging, Docker, and parallels included.
53:50 Try them for free at snap.ci slash talkpython.
53:53 Are you or a colleague trying to learn Python?
53:56 Have you tried books and videos that just left you bored by covering topics point
54:00 by point?
54:00 Well check out my online course Python Jumpstart by building 10 apps at talkpython.fm slash
54:06 course to experience a more engaging way to learn Python.
54:10 And if you're looking for something a little more advanced, try my Write Pythonic code
54:13 course at talkpython.fm/pythonic.
54:16 You can find the links from this episode at talkpython.fm/episodes slash
54:22 show slash 75.
54:24 Be sure to subscribe to the show.
54:26 Open your favorite podcatcher and search for Python.
54:29 We should be right at the top.
54:30 You can also find the iTunes feed at /itunes, Google Play feed at /play, and
54:36 direct RSS feed at /rss on talkpython.fm.
54:39 Our theme music is Developers, Developers, Developers by Corey Smith, who goes by
54:44 Smix.
54:44 Corey just recently started selling his tracks on iTunes, so I recommend you check it
54:48 out at talkpython.fm/music.
54:51 You can browse his tracks he has for sale on iTunes and listen to the full-length version
54:55 of the theme song.
54:56 This is your host, Michael Kennedy.
54:58 Thanks so much for listening.
55:00 I really appreciate it.
55:01 Smix, let's get out of here.
55:04 Staying with my voice.
55:05 There's no norm that I can feel within.
55:07 Haven't been sleeping.
55:08 I've been using lots of rest.
55:10 I'll pass the mic back to who rocked his best.
55:13 Developers.
55:16 Developers.
55:17 Developers.
55:18 Developers.
55:19 Developers.
55:20 Developers.
55:21 Developers.
55:21 Developers.
55:22 Well, first developers, developers, developers.
55:25 We'll be right back.
55:25 Thank you.