 Let me try to extend that. Thank you to a bunch of other people Like all the volunteers all the organizers This is a huge endeavor. So thank you to them the sponsors. Thank you very much Please if you can next time more money and the often forgotten technical people Like Mike Mateo out there that are doing sounds video Stage lighting and stage support. Let's have a quick hand for all these people. Thank you So, hello, my name is Tiago. I come from Lisbon in sunny, Portugal Which I invite you to visit you will be welcome and This story starts back in January when a very dear friend of mine came to me Knowing that I do these kinds of these kinds of these kinds of things professionally And he asked me Tiago Would you organize an introduction to programming with Python workshop for my oldest kid along with a few of his friends from school? Hmm Well, these kids are about 12 years old and of course I said yes knowing two things from the start The first one is that working with kids is a very serious business So an appropriately serious amount of preparation was in order and The other thing was that I wouldn't be able to reuse None of the materials tools exercises, whatever that I normally use when I train professional developers And here we go So instead I need to go for a much more informal approach like a learn by doing approach in a friendly fun If somewhat chaotic environments where kids would be really engaged into the thing Without you know kind of barriers So we would go for a learn by doing in a lots of many code along sessions Well, I would explain it maybe a simple concept type a few lines of Python Maybe one maybe two and they tap along in the run it and we do that repeatedly until we reached like a mini project that was fun and they could then explore and Then we did that three or four times and I wanted the last project to be something they would be really proud of They would take home and share with their friends and family You know and it would need to be a game now The we're having a problem with projection. May I plug in plug you need anything material? Are we okay? Okay I'll move on I'll move on you won't be able to see the code if it's not projecting, but I'll keep talking don't worry So we need it So given that we were starting from the turtle module I wanted to see if we could build the game with a turtle module. Okay, and if you don't know the top module Let me show it to you Hopefully I'll try that I'll try that so the turtle module implements as the name implies turtle graphics and turtle graphics are a thing that back from the 1960s Where you get a canvas, okay and a turtle This is from a programming environment called logo back then and you get a canvas in a turtle And essentially you can say things like turtle go forward a certain amount. You see The turtle goes for it. Okay And then you can say Well, dear turtle, can you please? turn left Then the dust on left Do we need to make a break to fix this? No problem. There's no problem at all. We can try and see what's going on So there's this certain amount of primitives that we can tell the turtle to do like you see, okay Let's table now. So it's just a glitch So now we turn the turtle we say go forward and now it goes forward in a different direction It keeps drawing a line. So it's pretty intuitive it behaves pretty much like a pencil on a sheet of paper and Pretty much like a pencil you can say well turtle go up Okay, it should be fly because the turtle should fly for kids, but it's forward no problem I mean if we now say go forward now it goes forward, but doesn't draw the line So it nicely animates this could be useful for a game I said oh this can be useful and then there's other fun things that we can do We can tell it go forward a negative amount of distance whatever and it goes backward which it's kind of intuitive Maybe and more if we bring it down again Such as it goes back to drawing lines as it moves We can also tell the turtle to go to a specific point in the canvas And it will go there directly in a straight line regardless of being facing Whatever it is so it's now kind of facing up But you tell it to go to the origin which is the point where it started in the center of the canvas And it goes it draws a straight line. Okay So the question is could we build the game with us and Again, the answer is yes, and let me show you okay What do I want to do I want to start with something like what's Python 3 7 maybe shall we Listen that's here game dot pie and we will make it executable And don't don't worry about this you really don't care about this what you care is this so we'll import it to module Okay, and we'll run it. It's like this And if you run this this main loop thing here, it's just like keeping the canvas when you open Okay, so let's pimp it up just a bit and we can pimp it up by setting up a screen thing. That's here Okay, and we say start x 600 to shift the canvas more towards the right hand side of the screen And we'd like to work with the known width and height so 640 should be enough for anyone mr. Bill Gates has said that so let's go that and Let's give it a nice orange background color and if you haven't made any horrible mistake We now have a nice orange canvas so it kind of game do we build with an orange canvas? Well given that minecraft in fortnight were taken. Okay, so we went a different route and in our game There will be two characters a player player control character aptly named kick player and a beast So it's the player and the beast and these characters Move around in the grid somehow constrained in the grid and the purpose is you control the player You need to capture the beast the beast runs away randomly. Okay, pretty simple much better than all those other fancy stuff So we will start by drawing a grid to help us out with this So bear with me for a minute and this will define the grid size Which is the grid size each cell size the grid span Which is the how many cells will have from the center of the canvas and we'll use this one grid max Which will be used all around so this would be grid size times Great great. No great size. Okay. Go and grid mad grid span and we'll draw the grid Using a line function that draws. I'm sorry line. So let's go here and here Well, we know these we can say total up and then we go total go to the starting point Like x1 y1 and then we duplicate these ones. They go down and now go to the end point Okay, so this would be to and to and now we can iterate over the range for for I in range of minus grid span to grid span, okay? Plus one because there's always this plus one isn't that skill I equals I times grid size and now we'll draw a line from minus grid max That's the leftmost edge. Let's say of the grid scaled I and To grid max skilled I If you run this and if I haven't made any horrors like there you go They told slowly trying to draw grid. So let's let's speed it up. Okay. Let's get it up. Hang on. Hang on We're just starting okay. Let's let's let's keep having some fun So we can say something that's not very intuitive at all if you look at the dots, but the speeds They tell you in the darks. It's from zero to ten from one to ten ten being the fastest But if you tell it to zero, it's even fastest. Okay, so we'll go you go zero Hi, you can hide the total and you can tell it like give it a nice You know dark orange background color because to match the background a nice orange color for the line Let's make it thicker, you know for force effects whatever and by the way, let's swap these coordinates here, okay and We get the vertical lines as well and we get a grid Much finer looking great, right? So this is a great we need the players the characters Okay, and one very interesting thing in the total module is that we can have as many turtles as you like Okay, we don't get just one. So how do we create a turtle like this? Let's see it You go player equals turtle. That's a module and there's a total class and that's it And you get a new turtle and you can have as many as you like And there's your turtle not a very engaging character in the game. Okay, you're 12 year old You want to see something more engaging? So there's yet another thing that the total module can do which is very cool Okay, if I can properly copy this line, of course. So that would be you can register a Shape and give it a file. Okay have on desk. I will be player give I'll tell you about the file in a moment in a moment And then once you do that you can tell the player total to use that shape once you do this You get this guy and now the kids eyes go. Oh, I like this. I know how to move this guy It's move and go to and forward. Okay? So let me tell you about these files in a quick minutes. So I brought brought along these two files here Which I obtained from open game art or okay go there lots of cool stuff. Thanks to the authors And the other thing we want to do of course is to control this player character with a keyboard So, how can we do that? Well, here's another trick that the total module has for us. So that's a two-step process Okay, we say something like this on key funk and then up and the idea is The listen function tells the main loop Okay, when it enters the main loop to keep this listening for keyboard events and this other call on key Tells the main loop to call the function funk every time the up key on my keyboard is pressed Okay, so we will need four of these because we want to control the player in all directions down left Left and right right right and it's for funk. Let's go a bit funky. Okay here I'll go with a lambda. Don't worry too much for now. I'll get just going. I'm just being generic here Okay, and when we move up and down x doesn't change when we move left and right Why doesn't change when we move up y is positive down is why is negative left? x is negative and right x is positive now if we just Need to create the move play function Don't you like the justs that we keep introducing our speech just just it seems as if it's obvious It's not okay, especially when working with beginners. So we will create the move player like this So it takes a delta x and the delta y so try to move the player relatively to where it is So if we knew where the player is we don't okay, we could do something like player go to remember this one wherever you are Plus the delta x x times the grid size, right? And wherever you are in the y axis plus the delta y times the grid size And if we knew the player position if only we knew the player position. Okay, that's it Okay, only we knew it and you go like this and now if I hit my keyboard. Oh, there it goes Okay, it's drawing the line because guess what that's what turtles do here. Okay, but we know how to fix that Okay, because we have the player fly or up method if we do this Then it moves nicely, okay, and it can go crazy, but we don't really care. Okay, it moves What's missing? Well the other character the beast, right? So we might feel tempted to Like copy and paste these we won't do that. You don't copy and paste go don't I'll do a few that but we'll get to that But so we'll instead create an actor function that will create an actor or a character for us Okay, and wait to do that could be one possible way would be let's say this image Okay, and image then we'll return this thing that we're creating here I don't like that it's called player because it doesn't make much sense any longer So let's call it T and say that player is actor Play your gif. Okay, and this should work. Okay, and now we can just copy it over and say beasts And we have player in the beast and there's the beast. Okay, it's sitting there still so let's make it move around So what we could create maybe a move beast function, okay Let's see find a move beast function here that will move it kind of randomly Run and for minus grid span to blah blah blah, you know, this is the boring part Sorry for that, but you know, there's no fun without paying I guess so we can say beast now go to guru. Okay. I'm kind of Japanese ish today X times grid size and Y times grid size, I guess And now this function just moves the beast at some point in random the grid We'll call it jump right before starting here And the other thing we're going to do is we'll need to import the random module right because we're using the random So there it goes. Okay, so it's there. Let's start it again. It's where it goes. Okay, so Okay, it goes there. Now the idea is that we'll move the player and as we move we need to see did we capture the beast? Yes or no, and we're going when we'll capture the beast the beast will do like a Let's call it a small dance as if as if it's stunned by being caught then it turns away again So the way to do that is let's say every time we move the player We will attempt a capture say a capture capture. Okay, and what's that? So attempting a capture might be something like well if the player position Equal to the beast position, right? Then beast do a dance doing a dance might be drawing a circle Which is yet another method of turtles that you know appropriately named draws a circle, but so this raise it won't draw Just do a little dance We'll reduce the steps to make it faster and then you say move beats So go away from wherever you are and let's see how it goes if I save this and run it so Dance goes away cool. Okay, dance goes away Dance goes away. Okay, cool, but it's really not challenging because as we move The beast is just sitting there. So it needs to be a bit more challenging. So maybe Whenever we move there's some odds that that the beast will try to cheat trick us Okay, so we might say something like well Else if we didn't capture. Okay, so maybe if random dot random This is we'll give us a random number between zero and one. Okay, we call it Lower than beat move beast odds. We'll just move the beast Okay, so the the bigger this number is the bigger the odds are the beast moving around the tricking out So we'll set this call it the game difficulty constant here and we'll say well Let's make it one in five two point two. So let's see how it goes So dangerous. This is random in a live coding scenario. So it might never happen But it did you see I'll just move around and see if the beast okay the beast It's very dumb sometimes if you really want to capture it You'll see there's some artificial intelligence here the random number. No, I know that I've been playing this and the kids No, too. So so if you take a look at this, okay? So the game is already cool. Okay, you can play it around but there's a very serious problem this game And that's it never ends and with kids you need games to end because at some point we'll be telling kids Come over its dinner time and they say hey dad, let me just finish the game. It doesn't finish. So it must finish Okay, so we'll introduce the concept of say of energy or karma Which will again be visually represented by yet another turtle, of course And we'll have a like a turtle center on top of the grid and the turtle will move slowly towards the left as the Player moves, okay, and if it ever reaches the left most edge the player loses and on the other hand Whenever the player captures the beast the karma will move like a chunk towards the right And if it ever reaches the right most edge the player wins, okay, so so let's build this step by step So we need a new turtle a new karma turtle. So let's go there Well, just yeah, this is the time for copying pacing right we can copy and paste this karma But oh come on. I don't have a karma dot-gif image on this So what what am I to do? Well, it turns out that if you look at our actor function that creates a turtle Registers the shape loads it from desk and then tells the turtle to use it Okay, it turns out there are a few built-in shapes in the turtle module that don't require registering Okay, and one of those is called Circle which will use here which will fail to register because registered try to open a file on desk So we'll say well if the name image ends with you know dot-gif Then register it otherwise assume. It's a built-in shape and just go ahead and do it And there's our karma turtle It's not the right place and it's kind of dark. No nobody wants a dark karma, right? So so let's make it shiny a bit. So one thing I'd like to do is something like maybe Color equals gold. I don't know and for that we'll add a like a Keyword argument here Defaulting to black so that I don't need to go back and change all the other code and say This is the turtle I created locally and say color Color, okay, and this should work and then we'll tell the comma turtle to go to zero That's horizontal center and then when max which is the top of the grid and just a little bit further up And that thing whenever you need it a little bit further up in a crazy number you go with 42 and nothing can go wrong So There you go. There's our karma turtle, okay, and now it needs to move depending on the result of the game and If you remember Even though it's a circle it's facing towards the right hand side, okay? So we'll use that forward positive number forward negative as a trick to move it left or right So that moving the karma turtle is just a matter of saying karma go for this number, okay? So to do that we'll create a an update karma function somewhere here Let's say well, well, well, well, maybe here not here. Yeah, I know maybe here So let's call update karma. It takes a delta karma which will be positive or negative Depending and we'll say go forward delta karma. That's it. Okay, and now in our attempt to capture We say well, this is a captured case So we'll say a plate karma with a karma value of a capture and we'll set this Variable to a positive value and then this is the case where we moved but didn't capture So we'll go there and say karma move and we'll set these two Here maybe Let's say this one is a hundred and maybe this one this one. I know it needs to be negative So let's go minus 20 say and we'll get go get back to our code and let's run it and see if it moves Okay, so it was a left, right so it was left and now it should Jump towards the right-hand side. Okay, this is working good You get the idea all we need to know to do now is to Find our boundary condition conditions detect them until game over you won game over you lost and we do that by Checking the karma position the horizontal position after every move So we'll we'll grab the comma x and comma y. We already know that these comma y equals A karma position right But we really don't care about the why so let's go like this. Okay, that's a throwaway variable and we say well if karma Where's my keyboard comma x it's greater than or equal to grid max then let's say in game We'll give it. Um, this is winning. So let's say yay victory Congratulations you won and otherwise we can say well if it's negative if it's below Negative grid max. So this is certainly a defeat. So let's go a defeat. Sorry for that try again We're end game or the end game function is a function that takes a message and uses the Right method of turtles that just this place text strings besides the turtles We don't have much control, but it's good enough We have control on over the alignment your horizontal alignment, which we'll try to center on the turtle We will override default font because the default font is actually too tiny for this kind of game and I thought why not go with Helvetica for two reasons. Okay, so it's a hallmark of Swiss design and it seemed appropriate And you really can't go wrong. No nobody was ever fired by using Helvetica So don't be creative with your thoughts use of that and you'll be fine. Okay, so if you I don't want to go off-rail But I love typography. So don't use other things. Don't be creative So this should work. Okay. So just write some message and we're going to test this by cheating a bit. So Because we don't have that much time. So we're just going to say, well, let's win this really quickly We'll always win really quickly. Uh, and here we go. So we move. Yeah, we're about to win. Anyway I don't really care. I'll go up and down. I went victory. Great. Um, so it seems to work The text is in black. I'd rather have it in white But if you recall the turtles default color is black, so I'll change it to white And there's another thing and that's a much more serious thing because if I head up, you see The game is still on. Okay. And why is that? Look at our curve. So we said in game, but what does in game does? We thought in game meant everything's done But all we did in in game. Sorry for that as we wrote the text message But originally when we set up the keyboard things we told listen and whenever this key is pressed do this and this Call the move it's still doing it. It's still doing that. We haven't told it stop doing that So ideally we would do turtle and less and so forget about the keyboard. Just be be still We can't do that. The turtle module doesn't have that. So we'll hack it away In a in a very ugly approach where it works. So I don't care Up down left left and right and I'll tell you a bit about why I think this is really bad later But if we have the time okay On key we'll we'll go the on key again, but now we'll say well for these keys Use the none function. So it means forget about any Thing you knew about this key. Okay, and we want the player turtle to be white. You remember that and this should be Pretty fast and cool like this So let's see. Okay down. I want to win really quickly. Yes We're in cheat mode because we are the cosers we can do anything right? It's very powerful victory good And I'll bang on my keyboard to see if it works. Okay. I'm banging This is one of those apple computers But one of those oldests that used to come out with the real keyboard. Okay, the new ones seem kind of flaky That's not the case. So tim, please fix the the keyboards. Okay. Thank you This is working and what I'm going to do is cheat the other way around to check that my losing condition is being properly checked Uh, and we're nearly done. Okay, so let's go minus What's minus 82? Why not? Let's make it go faster. Go go faster faster faster for kids is great So don't capture the beast. We want to lose this really quickly and the feet and banging our keyboard So the game is nearly done. Okay. This was my original plan for the game But the kids Came and said yes, but we need this core. Okay, we need the motive to come back to the game and do better That makes a lot of sense. Okay So they came up with this very simple and effective idea And what they came up with is well If we counted the number of steps that the player does along the the game and you just need to print them at the end So If you win you want to win with as few steps as possible. Okay, that's reasonable. It's a better score And if you lose, uh, I don't know ask the kids. Okay, so there's a score Let's let's let's implement that really quickly And the way to do that is one way to do that because there's no single way to do things. We'll do it like this Uh, well player steps equals zero start counting steps at zero. Okay when things start and then every time the player moves This is the function. We will just increment it Plus one Okay, and then if you remember there's a method here in game that writes a message with the you won your loss We'll just copy and paste that and use a comma turtle to write a different message We'll use a funky f-string. F-strings are so cool. Uh, don't you like them? Yeah player steps, uh, we'll make it Slightly smaller and this should be it. Let's see three three statements of python We've implemented a score. Isn't python cool the three steps. Good. Uh, so let's cheat the other way around Okay, or let's instead remove the cheat and Go for a real quick run of the game to get a feel Okay, and I won't go it till the end because this is one of those games that may never end so dangerous for the dinner thing with the kids, but It seems to work. Okay, it's fun engaging enough and I won't play it anymore I won't bore you because if you play it, you'll have fun. But just watching it is boring. Okay, so so let's Step back for a minute What we have here So you have 100 lines of python code Uh, created pretty much, you know, make it up as you go along way. Okay. Yeah, I don't care. I just create a function Oh, that's not cool. And what I'd like to do now is do a quick review of this code Of I'll highlight a few things. I don't have time for to go over all of it, of course How lighting maybe good ideas bad ideas. Would you do this at work? Yes or never? Okay, so let's get here for example these Variables or constants. These are a very good practice. Uh, the character movements and the grid drawing They're all based on these constants. So if we need to change something, let's say if I go five here Five can I go five please? Uh, five. Yeah, they know five Then it also works. Okay, so so this is clearly something that you would do at work It's a good practice. Okay to have common constants or variables and same can be said for these That's the game difficulty. Okay. That's a good thing Then I'm Going to take a look at these this is kind of a mess. So this loop draws the grid But it's difficult to read. I wouldn't want something like this in my serious sustainable code Maybe it's the variable names I selected. I don't know, but I don't like this very much It's hard to read. It's lots of John tree. I hate it But but it works. There you go And then there's this line this line deserves a mention because it could have been written as if image of minus 40 of blah blah blah equals to the dot k of These are semantically equivalent and I claim that the first one that I used is much better for two reasons First reason readability read that says if image ends with that so it's clear for you to your brain It's dark to your brain this string ends with that string Whereas in the other one Whether you're a beginner or an experienced professional something like this is going on more consciously or subconsciously What's that? Oh, that's the colon thing. The colon thing is a slice. It's from there to there What's the there on the right? Oh, there's nothing there on the right hand side. So that's still the end of the string Okay, what about minus four? So that's four from the end. Does it include the fourth from the end? Or is it from the fifth or from the month? It's a mess. Okay This happens in a split second for advanced developers and it takes a long time for beginners. It's not readable And then there's this If you change at some point your mind you want to use jpeg images Okay Then this line of code still works and the other one doesn't any longer because image of minus four till the end Is four characters long and dot jpeg is five characters long. So you need to change in two places You need to change your code in both sides of the comparison. So it's clearly a worse solution Okay, so go with ends width and starts with it's simpler. It's re it's either just use ends width and starts with Okay, keep it simple Now this deserves some mention too What's going on here? So we're calling the active function that creates a turtle ready to use Okay, so we're ready to play with it and then we're slapping a dot steps attribute there to counter steps it's our solution to Tracking the player steps and it's effective simple. Okay, so let's let's review this so in general everything in python is an object And python objects have a type and have attributes Now again in general any piece of code can You know create destroy Rebind or reassign values to Any attribute in any object? There's no protections There are some exceptions to this, but this is the fundamental model of the way python works Um, so in general this is not really a good idea because we're poking around at objects that might behave differently Okay, so this isn't something you would do at work But it's possible and again with great power comes great responsibility So use these kinds of things wisely, but I wouldn't want this in any serious sustainable code. Okay It would need to find different solutions to that uh now I'll highlight just one more Thing two more things for the sake of time so we can step back further more and again This statement could have been written as comma position Of zero or bracket error. And again, I say that the one I use is better for two reasons First again readability Okay, maybe for some people that funky thing with the comma comma and the score blah blah blah is somewhat strange Okay, but you'll quickly get used to that What I claim is that this line has the comma position in parenthesis and brackets and blah Okay, so it's slightly harder to read Okay, I'll grant you that might be a personal opinion But check this when you look at this code you wonder Well, could I have used 42 instead of zero or could I maybe maybe that comma position is a dictionary like thing Maybe could I have used key there? You don't know the only way to answer this these questions is to look at the function documentation Okay, or god forbid look at the source code You're you worried about your update karma function. You don't want to know about the others Whereas here, okay, you know that that karma position thing I'll short short it to right hand side is Iterable that's a funky thing. Okay, and we won't go into that. But think think Less like maybe it's it's a bunch of things. Okay, it's a bunch of things And if you want to know more we'll talk in the quarters And it's Iterable and it has two that's quite two Elements, okay, it's guaranteed to have that because there are two things here's comma separated Otherwise this code it wouldn't work. Okay, and by the way if we're using that underscore That's a variable like anyone like any other but it's a way of saying we don't really care about what's here Okay, so so we also know that we care about the first, okay? So it's clearly fist. No first So it's clear other than readability The line That I use gives you three facts Immediately and the other line leaves you with a few questions. Okay, so again, I say this is better And there's a very interesting article by trey hunter. I think Trey hunter. He's a trainer too, I think Go read it and come to me. I can point you to that. It's very interesting on this idea. Okay And let's wrap up our code review to move on to some different thoughts now. Just go here This is the most horrible two lines. I've written here in my understanding and why because There's repetition the the up down left and right string constants are repeated here and you see in this code That sets up the keyboard initially and that's really a no no no no So possible solutions would be to define constants with these values Wrap them in a list in a dictionary create an enum something like that. This is this is really you wouldn't do this I would be angry or disappointed someone said Tiago just created the best looking code out now I think we can improve that. Okay, so let's let's forget about the code for a minute. Okay, so this is the code Now Here are a few thoughts Well, the python senile iron is amazing. It has a bunch of functionality and it quite often it was it does surprise you. Okay It's it has its smelling corners. It does but if you dig deeper into a given Module, you're bound to be surprised and you're bound to find useful Functions tidbits examples. Okay, that was the case with the turtle module I didn't know you could do this with the turtle module keyboard input multiple turtles Give images I can do a bunch. Okay. I can nearly serve a breakfast with the turtle module. I don't know So there there have been recent discussions on the senile library and they're very relevant. I think but The fact of the matter is that the senile library is bound to change in the long term. Okay, but in the near term It will stay pretty much as it is and knowing it and using it is a very very valuable skill Don't rush into it. It takes time, but it pays back. So I learn a lot every time I go into the docs go docs python orgden library reference That's it. You go there. There's a bunch of cool things And then of course there's this, you know I'll read my own slides. Don't do this Direct in your face python is effective and fun and it is and maybe the reason why so many of us are here today Because one day we said, oh, this is python. Let me try this. Hmm funny Oh, cool. Oh, I like this. I want more and then 15 years later here. I don't know if you're relate to this This is what happened to me And having fun is obviously the best way to learn new things and the kids did learn a few things While the workshop was back in march and certainly three months after the fact or four or whatever They probably don't know much python now, but there's one thing they learned they will never forget And that is that their gaming consoles their tablets their Electronic devices. They're all programmable They have seen seen the lights in a way. They know there's a way to make the machine do something they want so Maybe in five ten twenty forty years time They're faced with some kind of software that That's just doesn't feel right for some reason and they know no no i'll fix it and i'll go Pick up back on that path and this is a very powerful thing to know that you can't really unlearn Okay, and this was my main objective with the kid. These machines you are the master So you can make them do whatever you want. Okay, so if you want go do that Now what if you're a professional seasoned developer four years experience you're you've done it all You've never done it all. Okay. That's my my opinion. There's always something else to do now. Would you do this at work? That's something like this exactly this this silly game Would you do it? Well, could you learn something from it? Would say extending it to network based gameplay Would you learn socket programming ip addressing ipv6 by the way at dns. I don't know bluetooth Would you learn that there's no way no technology no protocol No, whatever that guarantees that when you send the message out through the network There's no guarantee that you'll ever get back a response So you need to use timers and timeouts and things Would you learn something from it? or would that compel you to Write a low-level event loop Managing network traffic keyboard input and turtle animation and sound by the way. Why not? And would that help you? Understand different models of concurrent programming with coroutines and learning about the async and await Keywords that are so mysterious to many would that be helpful in something else that you do Would you learn about race conditions? This game here has race conditions You might say oh, I don't care about race conditions because I do data analysis And you know, you don't need network code to have race conditions You don't need to have a web-driven code to have race conditions All you need to have is concurrency and concurrency is everywhere more and more but tuning your mind into grasping what the race condition is and kind of smelling it from the distance and knowing how to avoid and Improve your code to avoid those because they are they are very difficult to diagnose and fix But if your mind is kind of tuned into that you've learned a very valuable skill, okay And so on and so forth. Okay, so I clearly say Yes, you should do this at work. Go ahead and tell your boss. Yeah, what are you doing? I'm doing a silly game Are you crazy? No, I'm not crazy. I'm learning the best way possible because I'm having a bunch of fun But don't do don't just do this at work. Okay, just do you balance it out? Okay now The parting fun is this and it came to me as I you know evolved and parted away from the workshop As that learning and having fun Hopefully learning while having fun Okay It's probably the best way to grow into better versions of ourselves And I think in the end that's what it's all about. I mean I've had a bunch of fun since January thinking discussion discussing working long nights A lot of work, but a bunch of fun for why did I do it for love? I don't know for passion for friendship for kids But I learned a lot too. Okay I'm still figuring out all that I learned from this experience And I humbly hope That all of this what shall I call it? This is not to talk. This is some silliness some fun That it might motivate you And inspire you to think Maybe to put away some time some energy or karma if you will And dedicate it to learning And having fun with whichever silly however silly whatever who are there to say oh, this is silly you do whatever you like so To dedicate some time and energy to having fun and learning and if if you need to choose if you can't have both Okay, go for fun. Okay, if you can't have learning and fun go for fun So this is it. Thank you very much I hope you go out and have a lot of fun. Thank you Thank you Tiago for this very entertaining talk We have a few minutes for questions if you want there's yes I'm happy to address anything about the code the kids the method and catch me out there I'll be happy to discuss all of this at any time. Okay. Go ahead. I'm more. Thank you I really love the message that you have about Providing kids to the ability to think. Yeah, I can tweak this on the future. I really don't know how it works But I know that it can be fixed. Yes. So my question is How would you address it to adults if you had to do something like this like 20 something or 30 something? That's a great question. Uh, I haven't thought about them that much, but this is a thought that Cross my mind a lot of times working with kids is serious business And you heard me say that because kids are very wide open So you can pretty much kind of drive them the way you want. Okay, so that's a huge responsibility Okay, so they're more malleable. So to speak Okay, that's why I meant that's what I meant that kids Working with kids is very serious. Okay, because you can't like mold them some way I don't know how I would do it adults because as we grow up we tend to become stiffer But in the end it's about showing and not telling if you show people something that resonates with them They will resonate with that and go from there So from an educational standpoint, I would say that it's about finding what resonates with your target audience And certainly what resonates with kids is a game like this And if I went to this with an adult, this wouldn't probably be interesting. It wouldn't resonate I'd say that that's the key idea But I'm happy to discuss this more It works Thank you very much. It was great. It was very important. I think but I have a neat pick You know, go ahead. Go ahead this pattern where you use a single underscore for a variable that you don't use. Have you ever Had the like had to use a get text Get text. Yes sure Yeah, get text is a way is a Module in the standard library that helps you internationalize or translate your code to different languages Okay, and it does a hack and uses this underscore variable that becomes a function so you Convert all your strengths that you say to the user say hello user And then you you wrap it up with underscore and parenthesis And then in another file, we say well, hello user is All out lisador. Hello swario, blah, blah, blah and all the language is and it and then it does that for you So thank you rather mere. That's a that's a great point as a like a counterpoint, okay, this code that we've seen is Much more advanced than what we did with the kids. We didn't do any kind of lambdas We didn't do loops so they they went like draw line draw line draw line draw line draw line draw line draw line So we would went for the basics. Thank you. That's a great nitpick and I'd like to Know how to solve that. I don't know I would like to that's why I'm asking. I have no idea. I never thought about it I never thought about it. Maybe you go with a double underscore variable. I don't know Good idea. Thanks right over here So it's gone red Um, yeah, I'm sorry Okay, so let's talk let's talk out there. Okay. Yeah, you can very very short question And how long did it take for the kids to reach this level of okay? We did Eight hours, okay two hours two hours two hours two hours across two days So two hours the morning and we went slowly, okay from I'm happy to share you the materials I have all the materials all the step by step lessons. Okay, but when they got here They were comfortable in a enough to vary some change some conditions play around, okay But this was like a bit too sophisticated for what they were comfortable with So it's kind of a balance between having fun being proud. Look what I did, but I don't completely understand it. Okay Okay, thank you. Thank you