Let's Play Robo Instructus () | Gameplay Commentary | Learn to Code

Let's Play Robo Instructus () | Gameplay Commentary | Learn to Code

Views:227|Rating:5.00|View Time:1:5:Minutes|Likes:7|Dislikes:0
Today we are playing Robo Instructus(). This video will serve is a walkthrough/explanation of the first few levels, and a practice run for potential stand alone videos in the future on the topics of game development/programming.

As always if you enjoyed the video give it a thumbs up, and drop a comment down below letting us know what you would like to see in the future.

To stay up to date on all our latest releases hit that subscribe button and the bell icon 😀

Robo Instructus is a puzzle game in which players maneuver a robot by issuing instructions via a simple programming language. As players progress through the game they unlock new functions to overcome new puzzles, each of which can be solved in multiple ways.

Steam Link:

hey what's up guys John here from quest accepted and today we are playing Robo instruct us which is a new game that just released on Steam and essentially what this game is attempting to do is it's trying to like gamify learning how to program or how to code so it kind of covers a bunch of basic concepts that you'll need if you were interested in game development or coding or you know like learning how to script in Python or something like that so we're gonna go ahead and hop into the game and I'll kind of walk you guys through the first couple of levels and sort of explain these concepts as we go okay so we're just gonna go ahead and start off I don't necessarily care what the story of the game is so we're just gonna kind of skip through all the text you know when you when you play it yourself you know I'm sure you'll take the time to actually read what's going on but basically you're like some astronaut or something and you have a robot companion and you know you have to program him to complete various tasks okay but you'll see as you begin a level it will introduce some concepts to you right so the first concepts we're learning here are how to move our character so we've got this Robo left command and we've got this Robo right Robo forward command okay and it tells you like how long it takes to run the commands and and you know what exactly the command does so over here on the left hand panel we're going to be typing in our commands you push this little play button to execute so what we have to do is we have to get our robot guy from here to the green area which is the you know the exit for the level so first thing we're gonna do here is we're gonna do Robo forward forward okay and that will you know move this guy up one tile so you'll see if we hit play he walks forward now the way this game works too is that whenever you do Robo forward he walks forward and then he turns to the right okay so you'll see he kind of walked forward and turned to the right there so we want him to walk forward and then we want to turn to the left so we're gonna go Robbo forward and then Robbo left okay and you'll see that now when we hit play he's gonna turn to the left so we're gonna do that basically all the way to the green here okay so we've got Robbo forward Robbo left and Robbo forward Robbo forward one more Robbo forward and then we're gonna have Robbo left Robbo forward Robbo left and then Robbo forward now if we hit play it's gonna run through all the way you know all the way through and you'll see execute each one of our commands here so pretty simple the first level it's just kind of introducing the basics of typing in the commands and then you know there's some message regarding the story but we don't really care for that okay so now we're gonna talk about loops so a loop is used to repeat a block of commands so you'll see here that in this example we've got the command loop and then it's indented with tab and then Robbo forward Robbo left so what's gonna happen is once we get you know it's gonna run this command Robbo forward one time and then it's gonna come down here to loop and it's gonna keep doing these this loop over and over and over and over and over again so like in game development typically you'll have what's called like a main like game loop and that is gonna be like what execute you know over and over and over again so if we think of something like let's say Donkey Kong right you're like jumping over their barrels yada yada yada when you start the game you know the game is gonna call the game loop you know one time up here primarily and then it's gonna go on go on and then there's gonna be like a game over function and it's gonna call that loop or you know like the main game loop again to start over and then it's gonna go through again and you know like all of the loop stuff in here is gonna be like jumping over barrels yadda yadda yadda okay and you'll see how this functions here in a moment okay so it kind of gives you a little grade based on how you put the code in how successful your code was as far as the time how many lines it took and all of that okay so level two here so you'll see that now we have multiple stages within one level okay so our solution that we type in over here has to be able to operate and successfully do all all four of these levels okay so first thing we want to be able to do want to walk forward go to left okay so Robo forward Robo left okay so that will accomplish this first level as you'll see so Robo for Robo left okay oh sorry rub a forward rubber left and then Robo forward again that will accomplish this first level and get us to the second level let's see on the second level we would need to add in more commands okay so it's saying rework to reach all exits okay so what we want to do is I mean we could if we wanted we could type red before we left Robo forward again and that would also complete the second level did we miss it oh sorry robo forward again robo left or here we'll just copy and place this whole block that'd be the easiest so you do this okay so you'll see that that will get us to the exit but then it's not gonna be the solution for all of these okay cuz you know on the last level here it doesn't get us to the end so what we're gonna do instead is we're gonna get rid of this and we're gonna say hey let's do a loop okay and we'll indent all of this right here okay so what the loop is gonna say is hey just keep running this command over and over and over again so now you'll see when we hit play it's just gonna keep running through this over and over and over again and because of the way this level is set up you know you're gonna complete the level every single time regardless of how long this goes on it's just gonna keep going and going and going and going okay so pretty simple stuff there and you'll see you know everywhere and programming loops are extremely powerful okay so now as far as the gamification of this goes we've added another little function here which is called robo scan okay so our robot guy here is going to scan the tile in front of him and it's going to return a value indicating the tile properties so l1 means that it's a normal tile so like the ones that we can stand on to means that it's an exit – like the green little thing up here one i mean- one means that there's no tile at all and then- 999 means that it's an unknown tile which you'll see in a second and we're also introducing conditionals which are if statements so basically if something is something then do this command so like in this example right here it says if robo scan is a one which means that there is a tile in front of you do the robo forward command so you can move forward okay and then in this other command it says if robo scan is negative one which means there is no tile in front of you turn to the left okay so now we've got two new commands that we can play around with here okay so we're gonna go ahead and hit exit level and go to the next level now you'll see here it says click to open the code reference so if at any point you forget these commands or you need to look and see you know what's up here you can just come up here to the code reference and see exactly what you've learned so far and what I like about this part of the game is that this is actually how it is when you're programming typically you're not gonna know all of the commands or you're gonna have to go figure something out so you're just gonna google it and you know there are tons and tons of websites out there that are dedicated to you know showing you the structure of various coding languages okay so there's some unfinished code found on this level try running it and reworking it or just start from scratch okay so we'll run it real fast and see what's gonna happen but first like let's look at the code and see if we can figure out what's gonna happen right so Robo forward we're gonna take a step forward and then it's gonna say if Robo scan is negative one do Robo forward okay so what's gonna end up happening here is our guy is gonna walk forward he's gonna turn to the right cuz that's what he does every time he walks forward he's gonna do a scan of like this area he's gonna see that there's no tile and then our robot is gonna walk forward and die okay so obviously that's not what we want to have happen so let's modify this code a little bit so we can say hey if Robo scan is negative one we want to do Robo left let's remove this comment okay and then we can say if Robo scan is one then you can do or actually it's gonna be Robo sorry it's gonna be if it's two because two is the exit right so a two is an exit okay so basically our guy's gonna step forward it's gonna say hey if the Robo scan is two we're gonna turn we're gonna walk forward but if it's one then we're going to turn left okay so scanned its all that hey that wasn't you know where we needed to go okay so we can we can clean this up a little bit so that it works a little bit better we can actually just say hey let's get rid of this all together and if Robo scan is negative one then we're gonna turn to the left and then we're also going to walk forward so you'll see now it's going to come up here it's going to scan turn the left and then walk forward all right so there was a second level here so now we need to consider the fact that we need to also be able to solve this based on our code so when we get here we need to be able to walk forward scan see that this is a – and walk forward so that's kind of like what our code said before so if Robo scan is – Robo board okay so now that should solve both of these puzzles for us okay so now we're introducing variables so if you've had you know any sort of middle level level math class like algebra you'll know that a variable is just basically a placeholder for something else so x equals five and then every time you see an X you get five so what we've got here is we're saying hey variable or var in this case based on you know how this is structured so our variable called scan is equal to the command Robo scan so this would actually be called like a function you know depending on you know what what language you're using you know the structure is gonna be a little bit different but whenever you see these like little parentheses like this typically these are functions so we're saying hey anytime we see the word scan we're gonna get our value from this function Robo scan so Robo scan is gonna scan it's gonna give us a value and then it's gonna say hey if the scan value was one then you can walk forward if the scan value was negative one then we're gonna walk to the left okay and then conditions too so basically this is saying you know essentially the same thing as the the last conditionals right if this condition is met do this if it's not then do this okay okay so now we're talking about the keyword is so the key word is compares two values producing either a true or a false so this is what's known as like a boolean so if something is true or false okay so basically what we're gonna say here is if the scan is this value so if it equals this you'll see that up here where we say variable scan equals this anytime we have this equal sign we're assigning the value anytime we have is we're saying does it match this okay so look down here where it says if scan is not one do this it's saying basically if it does not match this so that's the differences between the equal sign and the is okay so moving right along again I don't really care what the message is by all means pause and read what it said okay click to view all recovered messages so if we wanted to see what that said you could come over here and see what it said okay so now we're on a level you'll see that there are quite a few different things that we have to accomplish here so let's figure out what's going on let's let's hit play real fast and see what happens so actually let's let's look at our code here and see if we can figure out what is gonna happen before we even hit play so we're gonna do a loop which means these commands are going to run over and over again so variable scan equals Robo scan so anytime we see scan right here it's going to apply the value of the robust can so it's gonna scan in front of us it's gonna see that that's a 1 and it's gonna walk forward ok and then it's going to start the loop over again so then it's gonna scan in front of us again it's going to see that that is a negative 999 and then I imagine it's going to like break so it's probably gonna just stop working yeah so it just broke okay so we've got a we got to like put in a new condition for negative 999 okay so we'll say if the scan is 1 do Robbo hoard else sorry else if scan is negative 999 do robo robo underscore left okay so what this should have happened for us now is we should come up here we should look at this see that it's like this void area turn to the left we're gonna do another Robbo Ford right because the loop is gonna start over again get up here get up here and then it's gonna get here and it's not going to know how to how to deal with this okay so actually let's see it's gonna well let's hit play and we'll just see what happens yeah okay so it's gonna get here and it's not going to know what to do so what we can do up here is where our Robo Ford is we can say if the scan is one or if the scan is to do a robo Ford so now when it gets to that tile it's gonna walk on to it okay okay so now we've got a condition where the value for like an on tile is not in our description over here so let's go look at this level he was standing right here looking over the edge so what we've got to do now is we've got to say hey if it's a one or two go forward obviously if it's a non tile we don't want to walk forward so we're gonna turn left so we're gonna say else if scan is negative 999 or if it's or sorry or scan is negative one which is you know the value of no tile right I don't remember where that where that where that was there it is negative one means no tile at all okay so if it's negative one we're gonna turn left so now we'll hit play and it looks like our code is working pretty well here this is a pretty big map here and what I want you guys to notice too is over here wherever where we have these if and else commands if you didn't use the else like if you put if here and you put if here every time it ran the loop it would check both of those so that would add time or like processing time for your your like your program or your code because we said if it matches this you know do this then it's not even going to check this down here it's only going to worry about you know this part okay and you'll see like especially when you get really long strings of codes or like when you have functions nested inside of your code like being able to say hey only do this instead of this is really really important all right so we've got conditions three so after an if if you can use else to deal with the otherwise cases more easily oh I guess that's basically what we did right else versus else if is kind of like whatever is sort of like the same thing so if you've got multiple ones you can do if and then else ifs and then if all else fails basically you can do an else okay so basically it's gonna say like if this isn't true and like you know none of this other stuff is just gonna go down here to else okay so now we have a new function so Robo use so operates on the current tile her operates on the current tile returning tile specific data or zero otherwise okay and it takes 400 milliseconds to run that okay so that's how we scored there we could probably maybe we can improve that in some way okay so we're gonna come down here to the next level okay so these power switches have robust can code ten so whenever we scan one of these tiles that's gonna be a value of ten okay so one is a normal normal tile two is the exit negative one is no tile negative ninety nine is unknown and ten is a power switch okay so we have the ability to pause now okay so we can do like little steps forward hold alt to access more options while paused let's see not sure how that is different than what we were doing before but okay all right so I think we could probably just get rid of this code we just saw what it did right so it came up here and it powered on me the switch okay so let's uh let's just get rid of this and try and figure it out ourselves okay so we need to walk forward at least we're just going to go ahead and program Lupe's kind of like what we did in the previous the previous level so we're gonna say loop if Robo scan Robo scan is 1 or Robo scan is what was the other one – then we're gonna do Robo forward and then we had our else statement so else Robo scan is was a negative 1 or Robo scan is negative 999 okay so basically we've got the movement part of this down so basically regardless she's never gonna fall off the map at this point oh sorry Robo left so at this point he's never gonna fall off the map so if we hit play what does the same unexpected ID robot scan Oh Elsa so he's never gonna fall off the map he's just gonna keep wandering around in circles because he's never going to be able to hit this switch okay so the value of this switch was 10 so we're gonna say if the value of the switch is well will do another elsif we'll say else if the value is robo scan is 10 we'll just go ahead and walk forward Kate Robo Ford so we should we should at least be able to stand on this tile now so hit play so we got down here eventually all right so we can now stand on it now we need to be able to actually use the switch okay but I think what we're gonna do first is we are gonna clean up our code a little bit here so remember that variable so we're gonna do variable we'll call it scan equals Robo scan okay so everywhere that it says Robo scan down here we're just gonna replace it with scan and why this is important is now it's going to take that initial value of well do one robust can like each turn for each tile and it will apply it to all of these so let's get rid of this real fast well comment this out so to comment you just hit that little number sign but you'll see every single time that the code hits Robo scan it scans that's why he he scans the green over and over and over again right so if we go ahead and we one comment this takes can and will copy and paste it in everywhere down here I guess we could just erase this to it right we got to remove a little function symbols so now what you'll see is that it's going to scan one time per turn and then it's gonna assign or it's going to take that value and use it everywhere else okay so it's can one scan one scan once scan once all right so we've made our code much more efficient by using that little variable okay now we just have to sort out how to actually turn on this switch okay so if if our scan is 10 then we need to use what was that called the Robo use so we're gonna walk forward and we're gonna turn on the switch basically okay so Robo equals or not used sorry underscore use so that should make our guy walk over here and turn on this switch now what's gonna happen is we're gonna walk over here and I think we're gonna turn it back off yeah so we turned it back off which isn't great for us so what we need to do is we need to set up a variable that says you know basically whether or not this switch is turned on or off okay so let's go ahead and stop that and let's rework our code a little bit here okay so I think what we can do is we're going to change the way our command is structured up here so we're gonna say if scan is greater than or equal to 1 because 1 2 and 10 are all greater than or equal to 1 then walk forward okay so we can go ahead and get rid of this which means down here we can also say if scan is less than or equal to negative 1 then turn left okay so that kind of cut down our code a little bit there now what we need to do is we need to say if Robo use is 0 do Robo use okay because you'll remember a second ago when we were looking at this it said when you're on the tile basically if if you're on a tour if you're okay when you're operating on a tile return tile specific data or 0 otherwise so by like default our Robo yet use is going to be 0 ok so when we're on that tile it should say if robo uses zero then we're gonna use robo use so we're actually going to turn on the switch okay and if we step on this tile and the switch value is one which is what it's going to do when we turn it on the first time it should just walk over it Oh incorrect indentation okay so that that should fix that okay so we turned it on let's let's kind of walk step by step here and watch our code so you can kind of you can advance step by step here and see what your code is doing so we want to see so it's going to do our Robo scan so our scan returned to value of 10 which means that our character knows this is the switch tile okay so if our scan was greater than 10 which it is we're gonna walk forward so now we're walking forward if Robo use is zero which it isn't because we've already turned this on then it should walk basically it should just skip over this okay so actually what happened was it said Robo uses zero I guess by default when we're on the tile it's zero so then it turned it off but because the tile was zero it turned it back on so I turned it off turned it back on is what happened there okay but it accomplished the same thing just a weird roundabout way okay now I'm not really sure I don't think this is the best way to do this because you can see that he's pinging on every tile which isn't ideal we want him to like only peeing the tiles that are the switch so I'm pretty sure this is gonna work it's just gonna be slower than it needs to be let's go ahead and speed this up and see how far he gets into this so this does work but again I think you could probably do that better than what we did but for now we'll just carry on and maybe we'll come back and try and do it better here in a bit okay so function unlocked robo forward location returns the ID of the tile the robot is facing so I guess each tile has a unique identifier that we can use you know I guess to to maybe send the guy to the various tiles okay so scope so what scope is is it refers to where within a command you know various pieces of information are okay so you'll see here in this top example our indented code like those that come after loop or if lines represent scope a variable can only be used in the scope that it was declared in so if we're in this little command here so if scan is one and we declare a variable so anytime we have that equal sign we're declaring that the variable is something we're saying if scan is one our variable foo equals 123 and then we've got another command down here that says if you know foo is 123 then turn left and then here it says if foo is 123 it's going to fail because the variable foo was declared inside of this other command if that makes sense so what you'll see depending on like what programming language you're using or what software you're using sometimes you'll have like what is it called like public and private variables or you'll have like your your main function versus like your your loop function or like your start function where you're like basically declaring what variables are one time but then you can update them later so there's a lot of interesting things that go on with variables and where and where you cannot use them okay but for now this is pretty simple what they're trying to tell you here okay so the best scoring code in each category is automatically saved okay so our time wasn't that good and like I said it's probably because this code was running on every tile which isn't what we wanted but I think if we just separated separated out the greater than equal one so like if we made it that one two and then we made another one that was ten like we had before it would actually work better but you'll see that we use the least amount of lines basically and if we did it the other way there would be more lines but it would run faster okay so well uh we'll come back to that in a little bit all right so next level okay so we've got a new switch here so we've got something called Robo scan 11 so data stores so we're gonna click on this and learn something about one of the tiles so we're gonna click on this guy and it's gonna tell us the safe location ID of one of the tiles ok robust can scans the tile in front we already know all that and then okay so 11 is the new identifier so that stores location data and then again the power switch is just like last time so we've got some test code over here so let's look at it real fast and see if we can figure out what's going on so we've got this new variable called data store scan and that is equivalent to the Robo scan so that's the very first thing that happens when we turn this on so it's going to scan this tile in front of us and get some value based on our robust can and then variable in front one so robot or Robo front location return returns location idea of the tile in front of us so the number that is associated with with this tile is going to be stored in this variable then we're going to walk forward variable exit location is equivalent to Robo use so when we step on this and we use this tile we're gonna get an exit location okay and then variable in front two equals Robo forward location okay so we should immediately get a valuable for datastore right so this is an 11 we kind of knew that and then Robo forward location so we're gonna get an identifier for what this tile is so that is tile 7330 we walked forward so variable exit location equals Robo use so whenever we do our little Robo use command here we're gonna gain a new variable for exit location so tile 6150 which is this one is I guess a safe tile or that's where the exit is so variable in front two equals row before location so whatever this tile is it's about to tell us what what that tile identifier is so 2072 this kind of seems like useless information and then our guy's gonna walk forward okay but we now know that that's where the exit is so let's uh let's get rid of this because this seems useless let's go ahead and get rid of these and let's kind of reformat this a little bit okay so just like we did on the other the other ones we're gonna set up a loop here and it's gonna be the let's not fall off the map loop so we're going to say if robo scan is greater than or equal to 1 because 1 10 11 and 2 are all greater than 1 okay then we can walk forward okay so that's that's pretty simple there and we're gonna say else if Robo scan is less than or equal to negative 1 turn left okay so I think at this point our guys should basically just ping pong around the map what's going on here if robots can is okay okay so no is so yeah our guy's just gonna basically walk around in circles forever right now but he doesn't fall off which is good okay so we need to figure out how to use this exit variable okay so we need something that says like let's let's hit play again okay so right now okay so we have to we have to use this again real fast so that tile was tile 11 so right here where it says like Robo scan we're gonna say hey when you walk forward on to this guy this covers 11 this is gonna this is gonna run to the same problem where we had last time where it's going to keep doing this on every tile but for for the moment we'll just deal with it we're gonna say Robo use okay you okay so what's happening now is that when we step on this the first time and we do the well I say that but I guess actually what's happening is we are using robo use on this tile which isn't what what we want so we need to say let's see let's get rid of this actually you know let's do this let's do that variable business for the skin let's do variable scan equals Robo scan okay and we're just going to go ahead and fix all of this to clean that up okay so we've got scans now what we want to do is we want to say this is supposed to be if scan is 1 or scan is 2 then we'll do whatever right we'll just walk forward okay and then let's say else if scan is 10 or scan is 11 so let's see what what else is over here there's must be a power switch right okay so there's no power switches so I think just if the scan is 11 then if the scan is 11 then let's do Robo use or we need to we need to walk forward let's let's walk forward and then we're gonna Robo use which will give us our exit location right so let's hit play else oh else–if else–if scan is 11 okay okay so that's still not working Oh you variable exit location equals Robo use scan is 11 walk forward this is what we're doing right now and then Robo use so this should be updating so let's make it let's just make a little little command here that says if exit location or maybe bit let's let's move this down here variable or if exit location if exit location is zero is zero and we'll set the exit location to the value of Robo use okay because we're using robot use down here and when we're using this the value is zero by default since that's what we're declaring up here okay so we'll just go ahead and put that in that's like a little fix I'm not sure if by default our variables get to assign to zero or not but we should try this real fast see if it works okay so there's our exit location so we need to tell our guy that he can step on this right so now we need to say we need to say that yeah the Robo board location so if the tile in front of us is the value of exit location so if his exit location and walk forward whoops robo forward okay we can get rid of this that doesn't do anything for us we can get rid of that too all right let's try this real fast okay so we got to the eggs at that time got to that exit so that exit okay so that did work for us my might be able to clean that up a little bit okay so we've got another little command here we can talk about so loops – so the continue keyword can be used to restart a loop Midway while the break keyword can be used to exit the current loop okay so basically we can come down here and we can say hey you can redo this part so basically if the count is not – sort of if it's zero or if it's one do this if it's five or three or whatever then we're going to quit that loop okay so basically this is a counter so each time it's just going to keep counting until it gets to that value and then it's gonna stop okay we'll see if we actually have to use that for this next one so our time could have been better it did kind of look like we were doing some stuff that we didn't need to do here let's let's watch this again real fast so we scan that we robo used so why is it doing a green and then doing a orange green orange so it's doing the scan up there oh it's this forward location okay oh well we'll say that that's that's okay for now okay so this one looks pretty complicated so we don't even have like a starter command here so we're just going to kind of work off what we did last time so last time we said basically we need to come over here click on this find out where our exit location is so we're going to need that exit location variable again it's a variable exit location and that's going to equal what is it robo use I think it was robo use robo use alright and then we're gonna have a loop so basically that whole let's not fall off the map loop so if scan is one or scan is two then you can walk forward and then else if scan is ten right because we get power guys up here you can walk forward on that too we're gonna keep them separate just because I think we're gonna have to do different commands for our power guy up here okay so then else if scan is 11 we need to walk forward there and then tell stuff scan is negative 1 or negative 9 9 9 for those guys we need to turn to the left ok so that should have us just walking around in circles oh we need to say what the scan is ok so variable scan equals Robo scan so we're gonna scan and then we're going to take the value of scan and assign it to all of these things what are we talking about here Oh scan is okay so I should just basically walk around in circles forever okay simple enough now we need to be able to turn this thing on like we did last time so that was we said if exit location is zero which it is right yeah so exit location is zero then we need to do Robo use okay so let's say right here where we're where we say if scan is 11 which is what this thing is we're gonna robo forward and then we're gonna do if if exit location is zero do Robo use Robo use okay let's try that out something something's not working there okay let's walk it out step by step real fast see what's going on so we scan we scan it's an so our values 11 so it should come down here match this okay so our scan is 11 we need to walk board if exit location is 0 which it is then we need to Robo use oh we have to update our our thing so exit location equals Robo use that should do it Robo use okay let's try that guy did it so there's our exit location okay so just like last time now we need to be able to walk on to that so we said what do we say else if it was that forward location else if Robo board location is the exit location then we're gonna use Robo forward okay let's try that out hey Eric I should step here oh it's not even getting there it's because this is still a 999 I think so basically it's coming down here and it's getting to this command and it's seeing that 999 is what kind of triangle that is so it's not even getting to this so I think if we just take this and we put that on top of this it should work yep okay so now what's happening is that once we've crossed this this triangle we need to be able to get through one of these triangles so one of these triangles is what this switch represents okay so when we cross this triangle we need to say we need to reset our exit location variable so let's say whenever we cross this first exit location let's do so when we walk across it let's set exit location back to zero slow this down a little bit see how this works okay so our exit location went back to zero and now our exit location is two three three five which is this triangle up here so we walked across there nice I guess we don't even need to go over there let's see if it if it works for this last one too okay so there's our exit location so we just got to wait for our guy to walk all the way back over there speed it up a little bit okay so there's our new exit location walked up let's see what happens here so we don't have a way to turn on our switch at the moment so if our scan is 10 we need to do what we did on like the level two levels ago so we need to say if Robo use is zero then use Robo use right so I think I think this should work oh the indents all right let's let's go fast here okay so that that works that works too oh so we've got a couple different power switches now oh we didn't even go down to this one nice okay so another one bites the dust there okay so in this one and this loops so consider this use of loops that turns that turns left five times okay so variable loop count equals one loop if the loop count is greater than five break Robbo left okay so Robo left loop count equals count plus one so every time it goes through the loop it's gonna do you know loop count equals one loop count plus one equals two Luke count plus two equals three and then one salute count equals five it's gonna break okay while any kind of looping logic can be written with loop keywords for and while are also available and help create simpler code that achieves the same result yeah so basically you're saying while my you know while my code is or a while loop count is less than or equal to five run this code right so you're gonna keep looping over and over and over again or for so while or like for loop count one two three and four one two three four five do row by left and then basically if your number is larger than that it stops and what you could do too is you could say like 1 3 5 okay so let's see what we got now Robo location returns the ID of the current tile the robot is standing on okay so that's basically what we did a second ago just before we did the forward location so the one in front of us okay so we did it really fast which is good our solution size I guess could have been a little bit smaller I guess maybe we probably could well I don't know we could probably clean this up a little bit or like combine ten and eleven could combine ten and eleven to be I'll basically execute this whole block or no that would I would slow it down I don't know but I mean we did it pretty well there I think the most important thing is the time like your processing time okay so that's gonna be that and we're on to chapter two so for this video we're gonna call it if you enjoyed you know this video if you thought that this was helpful or if you're interested in programming type stuff we're gonna keep playing this game and see how far into it we can get also going to be doing some tutorials more than likely at some point for like unity or unreal maybe we'll do some Python programming in addition to all of like the game content that we're doing so definitely you know if you if you like that kind of stuff like comment let us know what you want to see hit that subscribe button if you enjoyed this if you want to see more and catch you guys in the next one peace

One Reply to “Let's Play Robo Instructus () | Gameplay Commentary | Learn to Code”

  1. Tord Ã…ke Larsson

    Ive been playing this for hours. Im not sure if Im too stupid for this. I dont understand much to be honest. I can only do the 5 first levels. I dont understand how you did the 6th level. Or I dont understand why the commands you wrote worked.

    Like what does this mean: (I dont understand why it works.) I know you say a little bit about why it works, but I cant wrap my head around it.
    if exit_location is 0
    exit_location = robo_use()

Leave a Reply

Your email address will not be published. Required fields are marked *